Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply priority execution in CI #7395

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 0 additions & 88 deletions .github/workflows/ci-examples.yml

This file was deleted.

119 changes: 118 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,30 @@ env:
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}

jobs:
core:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: temurin
- name: Clear existing docker image cache
run: docker image prune -af
- name: Setup Gradle Build Action
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-includes: |
caches
notifications
jdks
gradle-home-cache-cleanup: true
- name: Build and test with Gradle
run: |
./gradlew :testcontainers:check --no-daemon --continue --scan

find_gradle_jobs:
needs: [core]
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
Expand All @@ -59,7 +82,7 @@ jobs:
# we should not push empty results to the cache
READ_ONLY_REMOTE_GRADLE_CACHE: true
run: |
TASKS=$(./gradlew --no-daemon --parallel -q testMatrix | jq 'del(.[] | select(. == ":azure:check"))' --compact-output)
TASKS=$(./gradlew --no-daemon --parallel -q testMatrix | jq 'del(.[] | select(. == ":azure:check" or . == ":testcontainers:check" or startswith(":docs:")))' --compact-output)
echo $TASKS
echo "matrix={\"gradle_args\":$TASKS}" >> $GITHUB_OUTPUT
check:
Expand Down Expand Up @@ -87,3 +110,97 @@ jobs:
- name: Build and test with Gradle (${{matrix.gradle_args}})
run: |
./gradlew --no-daemon --continue --scan ${{matrix.gradle_args}}

find_examples_jobs:
needs: [check]
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: temurin
- name: Setup Gradle Build Action
uses: gradle/gradle-build-action@v2
- id: set-matrix
working-directory: ./examples/
env:
# Since we override the tests executor,
# we should not push empty results to the cache
READ_ONLY_REMOTE_GRADLE_CACHE: true
run: |
TASKS=$(./gradlew --no-daemon --parallel -q testMatrix)
echo $TASKS
echo "matrix={\"gradle_args\":$TASKS}" >> $GITHUB_OUTPUT
check_examples:
needs: [find_examples_jobs]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.find_examples_jobs.outputs.matrix) }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: temurin
- name: Clear existing docker image cache
run: docker image prune -af
- name: Setup Gradle Build Action
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
- name: Build and test Examples with Gradle (${{matrix.gradle_args}})
working-directory: ./examples/
run: |
./gradlew --no-daemon --continue --scan --info ${{matrix.gradle_args}}

find_docs_examples_jobs:
needs: [check_examples]
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: temurin
- name: Setup Gradle Build Action
uses: gradle/gradle-build-action@v2
- id: set-matrix
env:
# Since we override the tests executor,
# we should not push empty results to the cache
READ_ONLY_REMOTE_GRADLE_CACHE: true
run: |
TASKS=$(./gradlew --no-daemon --parallel -q testMatrix | jq 'map(select(startswith(":docs:")))' --compact-output)
echo $TASKS
echo "matrix={\"gradle_args\":$TASKS}" >> $GITHUB_OUTPUT
check_docs_examples:
needs: [find_docs_examples_jobs]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.find_docs_examples_jobs.outputs.matrix) }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8'
distribution: temurin
- name: Clear existing docker image cache
run: docker image prune -af
- name: Setup Gradle Build Action
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-includes: |
caches
notifications
jdks
gradle-home-cache-cleanup: true
- name: Build and test with Gradle (${{matrix.gradle_args}})
run: |
./gradlew --no-daemon --continue --scan ${{matrix.gradle_args}}
Loading