Skip to content

Commit bcd07e6

Browse files
committed
Refactor integ-tests into suites
- Extract 2 suites to make it possible to reduce concurrency - Add separate workflow for integ-test and integ-test-full
1 parent d74ee73 commit bcd07e6

5 files changed

+184
-149
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI-integ-test-full
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- 'dist/**'
8+
9+
permissions:
10+
contents: write
11+
12+
concurrency:
13+
group: integ-test-${{ github.ref }}
14+
cancel-in-progress: false
15+
16+
jobs:
17+
caching-integ-tests:
18+
uses: ./.github/workflows/suite-integ-test-caching.yml
19+
with:
20+
runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'
21+
skip-dist: true
22+
secrets: inherit
23+
24+
other-integ-tests:
25+
uses: ./.github/workflows/suite-integ-test-other.yml
26+
with:
27+
runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'
28+
skip-dist: true
29+
secrets: inherit

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

Lines changed: 16 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,18 @@ on:
88
- 'main'
99
- 'release/**'
1010
- 'dev/**' # Allow running tests on dev branches without a PR
11+
paths-ignore:
12+
- 'dist/**'
13+
14+
permissions:
15+
contents: write
1116

1217
concurrency:
13-
group: integ-tests-${{ github.ref }}
18+
group: integ-test-${{ github.ref }}
1419
cancel-in-progress: false
1520

1621
jobs:
17-
determine-suite:
18-
runs-on: ubuntu-latest
19-
outputs:
20-
runner-os: ${{ steps.determine-suite.outputs.suite == 'quick' && '["ubuntu-latest"]' || '["ubuntu-latest", "windows-latest", "macos-latest"]' }}
21-
suite: ${{ steps.determine-suite.outputs.suite }}
22-
steps:
23-
- name: Determine suite to run
24-
id: determine-suite
25-
run: |
26-
# Always run quick suite if we are not in the core `gradle/actions` repository
27-
# This reduces the load for developers working on 'main' on forks
28-
if [ "${{ github.repository }}" != "gradle/actions" ]; then
29-
echo "Not in core repository: suite=quick"
30-
echo "suite=quick" >> "$GITHUB_OUTPUT"
31-
exit 0
32-
fi
33-
34-
# Run full suite for push trigger with "[bot] Update dist directory" commit message
35-
if [ "${{ github.event.head_commit.message }}" == "[bot] Update dist directory" ]; then
36-
echo "Bot commit to main branch: suite=full"
37-
echo "suite=full" >> "$GITHUB_OUTPUT"
38-
exit 0
39-
fi
40-
41-
# Run quick suite for everything else
42-
echo "Everything else: suite=quick"
43-
echo "suite=quick" >> "$GITHUB_OUTPUT"
44-
4522
build-distribution:
46-
needs: [determine-suite]
4723
runs-on: ubuntu-latest
4824
steps:
4925
- name: Checkout sources
@@ -52,125 +28,16 @@ jobs:
5228
if: ${{ needs.determine-suite.outputs.suite != 'full' }}
5329
uses: ./.github/actions/build-dist
5430

55-
build-scan-publish:
56-
needs: [determine-suite, build-distribution]
57-
uses: ./.github/workflows/integ-test-build-scan-publish.yml
58-
with:
59-
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
60-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
61-
62-
cache-cleanup:
63-
needs: [determine-suite, build-distribution]
64-
uses: ./.github/workflows/integ-test-cache-cleanup.yml
65-
with:
66-
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
67-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
68-
69-
caching-config:
70-
needs: [determine-suite, build-distribution]
71-
uses: ./.github/workflows/integ-test-caching-config.yml
72-
with:
73-
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
74-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
75-
76-
dependency-graph:
77-
if: ${{ ! github.event.pull_request.head.repo.fork }}
78-
needs: [determine-suite, build-distribution]
79-
uses: ./.github/workflows/integ-test-dependency-graph.yml
80-
permissions:
81-
contents: write
82-
with:
83-
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
84-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
85-
86-
dependency-submission:
87-
if: ${{ ! github.event.pull_request.head.repo.fork }}
88-
needs: [determine-suite, build-distribution]
89-
uses: ./.github/workflows/integ-test-dependency-submission.yml
90-
permissions:
91-
contents: write
92-
with:
93-
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
94-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
95-
96-
dependency-submission-failures:
97-
if: ${{ ! github.event.pull_request.head.repo.fork }}
98-
needs: [determine-suite, build-distribution]
99-
uses: ./.github/workflows/integ-test-dependency-submission-failures.yml
100-
permissions:
101-
contents: write
102-
with:
103-
runner-os: '${{ needs.determine-suite.outputs.runner-os }}'
104-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
105-
106-
develocity-injection:
107-
if: ${{ ! github.event.pull_request.head.repo.fork }}
108-
needs: [determine-suite, build-distribution]
109-
uses: ./.github/workflows/integ-test-inject-develocity.yml
110-
with:
111-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
112-
secrets:
113-
DEVELOCITY_ACCESS_KEY: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}
114-
115-
provision-gradle-versions:
116-
needs: [determine-suite, build-distribution]
117-
uses: ./.github/workflows/integ-test-provision-gradle-versions.yml
118-
with:
119-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
120-
121-
restore-configuration-cache:
122-
if: ${{ ! github.event.pull_request.head.repo.fork }}
123-
needs: [determine-suite, build-distribution]
124-
uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
125-
with:
126-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
127-
secrets:
128-
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
129-
130-
restore-containerized-gradle-home:
131-
needs: [determine-suite, build-distribution]
132-
uses: ./.github/workflows/integ-test-restore-containerized-gradle-home.yml
133-
with:
134-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
135-
136-
restore-custom-gradle-home:
137-
needs: [determine-suite, build-distribution]
138-
uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml
139-
with:
140-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
141-
142-
restore-gradle-home:
143-
needs: [determine-suite, build-distribution]
144-
uses: ./.github/workflows/integ-test-restore-gradle-home.yml
145-
with:
146-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
147-
148-
restore-java-toolchain:
149-
needs: [determine-suite, build-distribution]
150-
uses: ./.github/workflows/integ-test-restore-java-toolchain.yml
151-
with:
152-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
153-
154-
sample-kotlin-dsl:
155-
needs: [determine-suite, build-distribution]
156-
uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml
157-
with:
158-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
159-
160-
sample-gradle-plugin:
161-
needs: [determine-suite, build-distribution]
162-
uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml
163-
with:
164-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
165-
166-
toolchain-detection:
167-
needs: [determine-suite, build-distribution]
168-
uses: ./.github/workflows/integ-test-detect-toolchains.yml
31+
caching-integ-tests:
32+
needs: build-distribution
33+
uses: ./.github/workflows/suite-integ-test-caching.yml
16934
with:
170-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
35+
skip-dist: false
36+
secrets: inherit
17137

172-
wrapper-validation:
173-
needs: [determine-suite, build-distribution]
174-
uses: ./.github/workflows/integ-test-wrapper-validation.yml
38+
other-integ-tests:
39+
needs: build-distribution
40+
uses: ./.github/workflows/suite-integ-test-other.yml
17541
with:
176-
skip-dist: ${{ needs.determine-suite.outputs.suite == 'full' }}
42+
skip-dist: false
43+
secrets: inherit

.github/workflows/integ-test-wrapper-validation.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
continue-on-error: true
3535

3636
- name: Check failure
37+
shell: bash
3738
run: |
3839
if [ "${{ steps.setup-gradle.outcome}}" != "failure" ] ; then
3940
echo "Expected validation to fail, but it didn't"
@@ -62,6 +63,7 @@ jobs:
6263
# below to not accidentally inject code into shell script or break its syntax
6364
FAILED_WRAPPERS: ${{ steps.action-test.outputs.failed-wrapper }}
6465
FAILED_WRAPPERS_MATCHES: ${{ steps.action-test.outputs.failed-wrapper == '' }}
66+
shell: bash
6567
run: |
6668
if [ "$FAILED_WRAPPERS_MATCHES" != "true" ] ; then
6769
echo "'outputs.failed-wrapper' has unexpected content: $FAILED_WRAPPERS"
@@ -89,6 +91,7 @@ jobs:
8991
VALIDATION_FAILED: ${{ steps.action-test.outcome == 'failure' }}
9092
FAILED_WRAPPERS: ${{ steps.action-test.outputs.failed-wrapper }}
9193
FAILED_WRAPPERS_MATCHES: ${{ steps.action-test.outputs.failed-wrapper == 'sources/test/jest/wrapper-validation/data/invalid/gradle-wrapper.jar|sources/test/jest/wrapper-validation/data/invalid/gradlе-wrapper.jar' }}
94+
shell: bash
9295
run: |
9396
if [ "$VALIDATION_FAILED" != "true" ] ; then
9497
echo "Expected validation to fail, but it didn't"
@@ -123,6 +126,7 @@ jobs:
123126
# Evaluate workflow expressions here as env variable values instead of inside shell script
124127
# below to not accidentally inject code into shell script or break its syntax
125128
VALIDATION_FAILED: ${{ steps.action-test.outcome == 'failure' }}
129+
shell: bash
126130
run: |
127131
if [ "$VALIDATION_FAILED" != "true" ] ; then
128132
echo "Expected validation to fail, but it didn't"
@@ -153,6 +157,7 @@ jobs:
153157
# Evaluate workflow expressions here as env variable values instead of inside shell script
154158
# below to not accidentally inject code into shell script or break its syntax
155159
VALIDATION_FAILED: ${{ steps.action-test.outcome == 'failure' }}
160+
shell: bash
156161
run: |
157162
if [ "$VALIDATION_FAILED" != "true" ] ; then
158163
echo "Expected validation to fail, but it didn't"
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI-integ-test
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner-os:
7+
type: string
8+
default: '["ubuntu-latest"]'
9+
skip-dist:
10+
type: boolean
11+
default: false
12+
13+
jobs:
14+
cache-cleanup:
15+
uses: ./.github/workflows/integ-test-cache-cleanup.yml
16+
with:
17+
runner-os: '${{ inputs.runner-os }}'
18+
skip-dist: ${{ inputs.skip-dist }}
19+
20+
caching-config:
21+
uses: ./.github/workflows/integ-test-caching-config.yml
22+
with:
23+
runner-os: '${{ inputs.runner-os }}'
24+
skip-dist: ${{ inputs.skip-dist }}
25+
26+
restore-configuration-cache:
27+
if: ${{ ! github.event.pull_request.head.repo.fork }}
28+
uses: ./.github/workflows/integ-test-restore-configuration-cache.yml
29+
with:
30+
skip-dist: ${{ inputs.skip-dist }}
31+
secrets:
32+
GRADLE_ENCRYPTION_KEY: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
33+
34+
restore-containerized-gradle-home:
35+
uses: ./.github/workflows/integ-test-restore-containerized-gradle-home.yml
36+
with:
37+
skip-dist: ${{ inputs.skip-dist }}
38+
39+
restore-custom-gradle-home:
40+
uses: ./.github/workflows/integ-test-restore-custom-gradle-home.yml
41+
with:
42+
skip-dist: ${{ inputs.skip-dist }}
43+
44+
restore-gradle-home:
45+
uses: ./.github/workflows/integ-test-restore-gradle-home.yml
46+
with:
47+
skip-dist: ${{ inputs.skip-dist }}
48+
49+
restore-java-toolchain:
50+
uses: ./.github/workflows/integ-test-restore-java-toolchain.yml
51+
with:
52+
skip-dist: ${{ inputs.skip-dist }}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: CI-integ-test
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner-os:
7+
type: string
8+
default: '["ubuntu-latest"]'
9+
skip-dist:
10+
type: boolean
11+
default: false
12+
13+
jobs:
14+
build-scan-publish:
15+
uses: ./.github/workflows/integ-test-build-scan-publish.yml
16+
with:
17+
runner-os: '${{ inputs.runner-os }}'
18+
skip-dist: ${{ inputs.skip-dist }}
19+
20+
dependency-graph:
21+
if: ${{ ! github.event.pull_request.head.repo.fork }}
22+
uses: ./.github/workflows/integ-test-dependency-graph.yml
23+
permissions:
24+
contents: write
25+
with:
26+
runner-os: '${{ inputs.runner-os }}'
27+
skip-dist: ${{ inputs.skip-dist }}
28+
29+
dependency-submission:
30+
if: ${{ ! github.event.pull_request.head.repo.fork }}
31+
uses: ./.github/workflows/integ-test-dependency-submission.yml
32+
permissions:
33+
contents: write
34+
with:
35+
runner-os: '${{ inputs.runner-os }}'
36+
skip-dist: ${{ inputs.skip-dist }}
37+
38+
dependency-submission-failures:
39+
if: ${{ ! github.event.pull_request.head.repo.fork }}
40+
uses: ./.github/workflows/integ-test-dependency-submission-failures.yml
41+
permissions:
42+
contents: write
43+
with:
44+
runner-os: '${{ inputs.runner-os }}'
45+
skip-dist: ${{ inputs.skip-dist }}
46+
47+
develocity-injection:
48+
if: ${{ ! github.event.pull_request.head.repo.fork }}
49+
uses: ./.github/workflows/integ-test-inject-develocity.yml
50+
with:
51+
skip-dist: ${{ inputs.skip-dist }}
52+
secrets:
53+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DV_SOLUTIONS_ACCESS_KEY }}
54+
55+
provision-gradle-versions:
56+
uses: ./.github/workflows/integ-test-provision-gradle-versions.yml
57+
with:
58+
runner-os: '${{ inputs.runner-os }}'
59+
skip-dist: ${{ inputs.skip-dist }}
60+
61+
sample-kotlin-dsl:
62+
uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml
63+
with:
64+
runner-os: '${{ inputs.runner-os }}'
65+
skip-dist: ${{ inputs.skip-dist }}
66+
67+
sample-gradle-plugin:
68+
uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml
69+
with:
70+
runner-os: '${{ inputs.runner-os }}'
71+
skip-dist: ${{ inputs.skip-dist }}
72+
73+
toolchain-detection:
74+
uses: ./.github/workflows/integ-test-detect-toolchains.yml
75+
with:
76+
skip-dist: ${{ inputs.skip-dist }}
77+
78+
wrapper-validation:
79+
uses: ./.github/workflows/integ-test-wrapper-validation.yml
80+
with:
81+
runner-os: '${{ inputs.runner-os }}'
82+
skip-dist: ${{ inputs.skip-dist }}

0 commit comments

Comments
 (0)