Skip to content

Commit

Permalink
Refactor integ-tests
Browse files Browse the repository at this point in the history
- Include test name in all job names
- Remove cache key delegation as it is unused
  • Loading branch information
bigdaz committed Aug 3, 2024
1 parent fb2e693 commit d74ee73
Show file tree
Hide file tree
Showing 18 changed files with 118 additions and 127 deletions.
28 changes: 1 addition & 27 deletions .github/workflows/ci-integ-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
runs-on: ubuntu-latest
outputs:
runner-os: ${{ steps.determine-suite.outputs.suite == 'quick' && '["ubuntu-latest"]' || '["ubuntu-latest", "windows-latest", "macos-latest"]' }}
cache-key-prefix: '0' # TODO DAZ Try this again ${{ steps.determine-suite.outputs.suite == 'quick' && '0' || github.run_number }}
suite: ${{ steps.determine-suite.outputs.suite }}
steps:
- name: Determine suite to run
Expand Down Expand Up @@ -58,23 +57,20 @@ jobs:
uses: ./.github/workflows/integ-test-build-scan-publish.yml
with:
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

cache-cleanup:
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-cache-cleanup.yml
with:
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
cache-key-prefix: '${{ needs.determine-suite.outputs.suite}}-${{github.run_number}}-' # Requires a fresh cache entry each run
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

caching-config:
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-caching-config.yml
with:
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

dependency-graph:
Expand All @@ -85,7 +81,6 @@ jobs:
contents: write
with:
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

dependency-submission:
Expand All @@ -96,7 +91,6 @@ jobs:
contents: write
with:
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

dependency-submission-failures:
Expand All @@ -107,16 +101,13 @@ jobs:
contents: write
with:
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

develocity-injection:
if: ${{ ! github.event.pull_request.head.repo.fork }}
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-inject-develocity.yml
with:
runner-os: '["ubuntu-latest"]'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
secrets:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}
Expand All @@ -125,17 +116,13 @@ jobs:
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-provision-gradle-versions.yml
with:
runner-os: '["ubuntu-latest"]'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

restore-configuration-cache:
if: ${{ ! github.event.pull_request.head.repo.fork }}
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
with:
runner-os: '["ubuntu-latest"]'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
secrets:
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
Expand All @@ -144,59 +131,46 @@ jobs:
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-restore-containerized-gradle-home.yml
with:
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

restore-custom-gradle-home:
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml
with:
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

restore-gradle-home:
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-restore-gradle-home.yml
with:
runner-os: '["ubuntu-latest"]'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

restore-java-toolchain:
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-restore-java-toolchain.yml
with:
runner-os: '["ubuntu-latest"]'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

sample-kotlin-dsl:
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml
with:
runner-os: '["ubuntu-latest"]'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

sample-gradle-plugin:
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml
with:
runner-os: '["ubuntu-latest"]'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

toolchain-detection:
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-detect-java-toolchains.yml
uses: ./.github/workflows/integ-test-detect-toolchains.yml
with:
runner-os: '["ubuntu-latest"]'
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

wrapper-validation:
needs: [determine-suite, build-distribution]
uses: ./.github/workflows/integ-test-wrapper-validation.yml
with:
runner-os: '["ubuntu-latest"]'
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
3 changes: 2 additions & 1 deletion .github/workflows/integ-test-build-scan-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on:
inputs:
cache-key-prefix:
type: string
default: '0'
runner-os:
type: string
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
default: '["ubuntu-latest"]'
skip-dist:
type: boolean
default: false
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/integ-test-cache-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ on:
inputs:
cache-key-prefix:
type: string
default: '0'
runner-os:
type: string
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
default: '["ubuntu-latest"]'
skip-dist:
type: boolean
default: false

env:
SKIP_DIST: ${{ inputs.skip-dist }}
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: cache-cleanup-${{ inputs.cache-key-prefix }}
# Requires a fresh cache entry each run
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: cache-cleanup-${{ inputs.cache-key-prefix }}-${{github.run_number}}

jobs:
full-build:
cache-cleanup-full-build:
strategy:
fail-fast: false
matrix:
Expand All @@ -38,8 +40,8 @@ jobs:
run: ./gradlew --no-daemon --build-cache -Dcommons_math3_version="3.1" build

# Second build will use the cache from the first build, but cleanup should remove unused artifacts
assemble-build:
needs: full-build
cache-cleanup-assemble-build:
needs: cache-cleanup-full-build
strategy:
fail-fast: false
matrix:
Expand All @@ -60,8 +62,8 @@ jobs:
working-directory: sources/test/jest/resources/cache-cleanup
run: ./gradlew --no-daemon --build-cache -Dcommons_math3_version="3.1.1" build

check-clean-cache:
needs: assemble-build
cache-cleanup-check-clean-cache:
needs: cache-cleanup-assemble-build
strategy:
fail-fast: false
matrix:
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/integ-test-caching-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on:
inputs:
cache-key-prefix:
type: string
default: '0'
runner-os:
type: string
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
default: '["ubuntu-latest"]'
skip-dist:
type: boolean
default: false
Expand All @@ -17,7 +18,7 @@ env:
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: caching-config-${{ inputs.cache-key-prefix }}

jobs:
seed-build:
caching-config-seed-build:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -46,8 +47,8 @@ jobs:
run: ./gradlew test

# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
verify-build:
needs: seed-build
caching-config-verify-build:
needs: caching-config-seed-build
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -75,7 +76,7 @@ jobs:
run: ./gradlew test --offline

# Test that build scans are captured when caching is explicitly disabled
cache-disabled:
caching-config-cache-disabled:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -103,7 +104,7 @@ jobs:
core.setFailed('No Build Scan detected')
# Test that build scans are captured when caching is disabled because Gradle User Home already exists
cache-disabled-pre-existing-gradle-home:
caching-config-cache-disabled-pre-existing-gradle-home:
runs-on: ubuntu-latest # This test only runs on Ubuntu
steps:
- name: Checkout sources
Expand All @@ -127,9 +128,9 @@ jobs:
core.setFailed('No Build Scan detected')
# Test seed the cache with cache-write-only and verify with cache-read-only
seed-build-write-only:
caching-config-seed-write-only:
env:
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{ inputs.cache-key-prefix }}-write-only-
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: caching-config-write-only-${{ inputs.cache-key-prefix }}
strategy:
fail-fast: false
matrix:
Expand All @@ -149,10 +150,10 @@ jobs:
working-directory: .github/workflow-samples/groovy-dsl
run: ./gradlew test

verify-write-only-build:
caching-config-verify-write-only:
env:
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{ inputs.cache-key-prefix }}-write-only-
needs: seed-build-write-only
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: caching-config-write-only-${{ inputs.cache-key-prefix }}
needs: caching-config-seed-write-only
strategy:
fail-fast: false
matrix:
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/integ-test-dependency-graph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ on:
inputs:
cache-key-prefix:
type: string
default: '0'
runner-os:
type: string
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
default: '["ubuntu-latest"]'
skip-dist:
type: boolean
default: false
Expand All @@ -21,7 +22,7 @@ env:
GITHUB_DEPENDENCY_GRAPH_REF: 'refs/tags/v0.0.1' # Use a different ref to avoid updating the real dependency graph for the repository

jobs:
groovy-upload:
dependency-graph-groovy-upload:
strategy:
fail-fast: false
matrix:
Expand All @@ -41,8 +42,8 @@ jobs:
run: ./gradlew build
working-directory: .github/workflow-samples/groovy-dsl

groovy-submit:
needs: [groovy-upload]
dependency-graph-groovy-submit:
needs: [dependency-graph-groovy-upload]
runs-on: "ubuntu-latest"
steps:
- name: Checkout sources
Expand All @@ -57,7 +58,7 @@ jobs:
env:
DEPENDENCY_GRAPH_DOWNLOAD_ARTIFACT_NAME: groovy-upload

kotlin-generate-and-submit:
dependency-graph-kotlin-generate-and-submit:
strategy:
fail-fast: false
matrix:
Expand All @@ -77,7 +78,7 @@ jobs:
run: ./gradlew build
working-directory: .github/workflow-samples/kotlin-dsl

multiple-builds:
dependency-graph-multiple-builds:
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -122,7 +123,7 @@ jobs:
exit 1
fi
config-cache:
dependency-graph-config-cache:
runs-on: ubuntu-latest # Test is not compatible with Windows
steps:
- name: Checkout sources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
inputs:
cache-key-prefix:
type: string
default: '0'
runner-os:
type: string
default: '["ubuntu-latest"]'
Expand All @@ -18,7 +19,7 @@ env:
GITHUB_DEPENDENCY_GRAPH_REF: 'refs/tags/v0.0.1' # Use a different ref to avoid updating the real dependency graph for the repository

jobs:
failing-build:
dependency-submission-failures-failing-build:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand Down Expand Up @@ -47,7 +48,7 @@ jobs:
exit 1
fi
unsupported-gradle-version:
dependency-submission-failures-unsupported-gradle-version:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
Expand Down Expand Up @@ -76,7 +77,7 @@ jobs:
exit 1
fi
insufficient-permissions:
dependency-submission-failures-insufficient-permissions:
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
Loading

0 comments on commit d74ee73

Please sign in to comment.