Skip to content

Commit d74ee73

Browse files
committed
Refactor integ-tests
- Include test name in all job names - Remove cache key delegation as it is unused
1 parent fb2e693 commit d74ee73

18 files changed

+118
-127
lines changed

.github/workflows/ci-integ-test.yml

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
runs-on: ubuntu-latest
1919
outputs:
2020
runner-os: ${{ steps.determine-suite.outputs.suite == 'quick' && '["ubuntu-latest"]' || '["ubuntu-latest", "windows-latest", "macos-latest"]' }}
21-
cache-key-prefix: '0' # TODO DAZ Try this again ${{ steps.determine-suite.outputs.suite == 'quick' && '0' || github.run_number }}
2221
suite: ${{ steps.determine-suite.outputs.suite }}
2322
steps:
2423
- name: Determine suite to run
@@ -58,23 +57,20 @@ jobs:
5857
uses: ./.github/workflows/integ-test-build-scan-publish.yml
5958
with:
6059
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
61-
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
6260
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
6361

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

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

8076
dependency-graph:
@@ -85,7 +81,6 @@ jobs:
8581
contents: write
8682
with:
8783
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
88-
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
8984
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
9085

9186
dependency-submission:
@@ -96,7 +91,6 @@ jobs:
9691
contents: write
9792
with:
9893
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
99-
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
10094
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
10195

10296
dependency-submission-failures:
@@ -107,16 +101,13 @@ jobs:
107101
contents: write
108102
with:
109103
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
110-
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
111104
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
112105

113106
develocity-injection:
114107
if: ${{ ! github.event.pull_request.head.repo.fork }}
115108
needs: [determine-suite, build-distribution]
116109
uses: ./.github/workflows/integ-test-inject-develocity.yml
117110
with:
118-
runner-os: '["ubuntu-latest"]'
119-
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
120111
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
121112
secrets:
122113
DEVELOCITY_ACCESS_KEY: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}
@@ -125,17 +116,13 @@ jobs:
125116
needs: [determine-suite, build-distribution]
126117
uses: ./.github/workflows/integ-test-provision-gradle-versions.yml
127118
with:
128-
runner-os: '["ubuntu-latest"]'
129-
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
130119
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
131120

132121
restore-configuration-cache:
133122
if: ${{ ! github.event.pull_request.head.repo.fork }}
134123
needs: [determine-suite, build-distribution]
135124
uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
136125
with:
137-
runner-os: '["ubuntu-latest"]'
138-
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
139126
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
140127
secrets:
141128
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
@@ -144,59 +131,46 @@ jobs:
144131
needs: [determine-suite, build-distribution]
145132
uses: ./.github/workflows/integ-test-restore-containerized-gradle-home.yml
146133
with:
147-
cache-key-prefix: '${{ needs.determine-suite.outputs.cache-key-prefix }}-'
148134
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
149135

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

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

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

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

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

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

197172
wrapper-validation:
198173
needs: [determine-suite, build-distribution]
199174
uses: ./.github/workflows/integ-test-wrapper-validation.yml
200175
with:
201-
runner-os: '["ubuntu-latest"]'
202176
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}

.github/workflows/integ-test-build-scan-publish.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ on:
55
inputs:
66
cache-key-prefix:
77
type: string
8+
default: '0'
89
runner-os:
910
type: string
10-
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
11+
default: '["ubuntu-latest"]'
1112
skip-dist:
1213
type: boolean
1314
default: false

.github/workflows/integ-test-cache-cleanup.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ on:
55
inputs:
66
cache-key-prefix:
77
type: string
8+
default: '0'
89
runner-os:
910
type: string
10-
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
11+
default: '["ubuntu-latest"]'
1112
skip-dist:
1213
type: boolean
1314
default: false
1415

1516
env:
1617
SKIP_DIST: ${{ inputs.skip-dist }}
17-
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: cache-cleanup-${{ inputs.cache-key-prefix }}
18+
# Requires a fresh cache entry each run
19+
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: cache-cleanup-${{ inputs.cache-key-prefix }}-${{github.run_number}}
1820

1921
jobs:
20-
full-build:
22+
cache-cleanup-full-build:
2123
strategy:
2224
fail-fast: false
2325
matrix:
@@ -38,8 +40,8 @@ jobs:
3840
run: ./gradlew --no-daemon --build-cache -Dcommons_math3_version="3.1" build
3941

4042
# Second build will use the cache from the first build, but cleanup should remove unused artifacts
41-
assemble-build:
42-
needs: full-build
43+
cache-cleanup-assemble-build:
44+
needs: cache-cleanup-full-build
4345
strategy:
4446
fail-fast: false
4547
matrix:
@@ -60,8 +62,8 @@ jobs:
6062
working-directory: sources/test/jest/resources/cache-cleanup
6163
run: ./gradlew --no-daemon --build-cache -Dcommons_math3_version="3.1.1" build
6264

63-
check-clean-cache:
64-
needs: assemble-build
65+
cache-cleanup-check-clean-cache:
66+
needs: cache-cleanup-assemble-build
6567
strategy:
6668
fail-fast: false
6769
matrix:

.github/workflows/integ-test-caching-config.yml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ on:
55
inputs:
66
cache-key-prefix:
77
type: string
8+
default: '0'
89
runner-os:
910
type: string
10-
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
11+
default: '["ubuntu-latest"]'
1112
skip-dist:
1213
type: boolean
1314
default: false
@@ -17,7 +18,7 @@ env:
1718
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: caching-config-${{ inputs.cache-key-prefix }}
1819

1920
jobs:
20-
seed-build:
21+
caching-config-seed-build:
2122
strategy:
2223
fail-fast: false
2324
matrix:
@@ -46,8 +47,8 @@ jobs:
4647
run: ./gradlew test
4748

4849
# Test that the gradle-user-home cache will cache dependencies, by running build with --offline
49-
verify-build:
50-
needs: seed-build
50+
caching-config-verify-build:
51+
needs: caching-config-seed-build
5152
strategy:
5253
fail-fast: false
5354
matrix:
@@ -75,7 +76,7 @@ jobs:
7576
run: ./gradlew test --offline
7677

7778
# Test that build scans are captured when caching is explicitly disabled
78-
cache-disabled:
79+
caching-config-cache-disabled:
7980
strategy:
8081
fail-fast: false
8182
matrix:
@@ -103,7 +104,7 @@ jobs:
103104
core.setFailed('No Build Scan detected')
104105
105106
# Test that build scans are captured when caching is disabled because Gradle User Home already exists
106-
cache-disabled-pre-existing-gradle-home:
107+
caching-config-cache-disabled-pre-existing-gradle-home:
107108
runs-on: ubuntu-latest # This test only runs on Ubuntu
108109
steps:
109110
- name: Checkout sources
@@ -127,9 +128,9 @@ jobs:
127128
core.setFailed('No Build Scan detected')
128129
129130
# Test seed the cache with cache-write-only and verify with cache-read-only
130-
seed-build-write-only:
131+
caching-config-seed-write-only:
131132
env:
132-
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{ inputs.cache-key-prefix }}-write-only-
133+
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: caching-config-write-only-${{ inputs.cache-key-prefix }}
133134
strategy:
134135
fail-fast: false
135136
matrix:
@@ -149,10 +150,10 @@ jobs:
149150
working-directory: .github/workflow-samples/groovy-dsl
150151
run: ./gradlew test
151152

152-
verify-write-only-build:
153+
caching-config-verify-write-only:
153154
env:
154-
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: ${{ inputs.cache-key-prefix }}-write-only-
155-
needs: seed-build-write-only
155+
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: caching-config-write-only-${{ inputs.cache-key-prefix }}
156+
needs: caching-config-seed-write-only
156157
strategy:
157158
fail-fast: false
158159
matrix:

.github/workflows/integ-test-dependency-graph.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ on:
55
inputs:
66
cache-key-prefix:
77
type: string
8+
default: '0'
89
runner-os:
910
type: string
10-
default: '["ubuntu-latest", "windows-latest", "macos-latest"]'
11+
default: '["ubuntu-latest"]'
1112
skip-dist:
1213
type: boolean
1314
default: false
@@ -21,7 +22,7 @@ env:
2122
GITHUB_DEPENDENCY_GRAPH_REF: 'refs/tags/v0.0.1' # Use a different ref to avoid updating the real dependency graph for the repository
2223

2324
jobs:
24-
groovy-upload:
25+
dependency-graph-groovy-upload:
2526
strategy:
2627
fail-fast: false
2728
matrix:
@@ -41,8 +42,8 @@ jobs:
4142
run: ./gradlew build
4243
working-directory: .github/workflow-samples/groovy-dsl
4344

44-
groovy-submit:
45-
needs: [groovy-upload]
45+
dependency-graph-groovy-submit:
46+
needs: [dependency-graph-groovy-upload]
4647
runs-on: "ubuntu-latest"
4748
steps:
4849
- name: Checkout sources
@@ -57,7 +58,7 @@ jobs:
5758
env:
5859
DEPENDENCY_GRAPH_DOWNLOAD_ARTIFACT_NAME: groovy-upload
5960

60-
kotlin-generate-and-submit:
61+
dependency-graph-kotlin-generate-and-submit:
6162
strategy:
6263
fail-fast: false
6364
matrix:
@@ -77,7 +78,7 @@ jobs:
7778
run: ./gradlew build
7879
working-directory: .github/workflow-samples/kotlin-dsl
7980

80-
multiple-builds:
81+
dependency-graph-multiple-builds:
8182
strategy:
8283
fail-fast: false
8384
matrix:
@@ -122,7 +123,7 @@ jobs:
122123
exit 1
123124
fi
124125
125-
config-cache:
126+
dependency-graph-config-cache:
126127
runs-on: ubuntu-latest # Test is not compatible with Windows
127128
steps:
128129
- name: Checkout sources

.github/workflows/integ-test-dependency-submission-failures.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
inputs:
66
cache-key-prefix:
77
type: string
8+
default: '0'
89
runner-os:
910
type: string
1011
default: '["ubuntu-latest"]'
@@ -18,7 +19,7 @@ env:
1819
GITHUB_DEPENDENCY_GRAPH_REF: 'refs/tags/v0.0.1' # Use a different ref to avoid updating the real dependency graph for the repository
1920

2021
jobs:
21-
failing-build:
22+
dependency-submission-failures-failing-build:
2223
runs-on: ubuntu-latest
2324
steps:
2425
- name: Checkout sources
@@ -47,7 +48,7 @@ jobs:
4748
exit 1
4849
fi
4950
50-
unsupported-gradle-version:
51+
dependency-submission-failures-unsupported-gradle-version:
5152
runs-on: ubuntu-latest
5253
steps:
5354
- name: Checkout sources
@@ -76,7 +77,7 @@ jobs:
7677
exit 1
7778
fi
7879
79-
insufficient-permissions:
80+
dependency-submission-failures-insufficient-permissions:
8081
runs-on: ubuntu-latest
8182
permissions:
8283
contents: read

0 commit comments

Comments
 (0)