Repository navigation
210 lines (201 loc) · 7.07 KB
/
Copy pathci.yml
File metadata and controls
210 lines (201 loc) · 7.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: CI
on:
pull_request:
paths-ignore:
- '.github/ISSUE_TEMPLATE/*.yaml'
- '.github/CODEOWNERS'
- '.github/pull_request_template.md'
- 'docs/**/*.css'
- 'docs/**/*.html'
- 'docs/**/*.ico'
- 'docs/**/*.md'
- 'docs/**/*.png'
- 'docs/**/*.svg'
- 'mkdocs.yml'
- 'README.md'
- 'RELEASING.md'
- '.sdkmanrc'
push:
branches: [ main ]
paths-ignore:
- '.github/ISSUE_TEMPLATE/*.yaml'
- '.github/CODEOWNERS'
- '.github/pull_request_template.md'
- 'docs/**/*.css'
- 'docs/**/*.html'
- 'docs/**/*.ico'
- 'docs/**/*.md'
- 'docs/**/*.png'
- 'docs/**/*.svg'
- 'mkdocs.yml'
- 'README.md'
- 'RELEASING.md'
- '.sdkmanrc'
concurrency:
group: "${{ github.workflow }}-${{ github.head_ref || github.sha }}"
cancel-in-progress: true
permissions:
contents: read
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
jobs:
core:
runs-on: ubuntu-22.04
permissions:
checks: write
strategy:
matrix:
java: [ '17', '21' ]
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-build
with:
java-version: ${{ matrix.java }}
- name: Build and test with Gradle
run: |
./gradlew :testcontainers:check --no-daemon --continue --scan
- uses: ./.github/actions/setup-junit-report
turbo-mode:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: ubuntu-22.04
permissions:
checks: write
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-build
- name: Setup Testcontainers Cloud Client
uses: atomicjar/testcontainers-cloud-setup-action@main
with:
token: ${{ secrets.TC_CLOUD_TOKEN }}
args: --max-concurrency=4
- name: Test using Testcontainers Cloud with Turbo Mode enabled
working-directory: ./smoke-test/
run: |
./gradlew check --no-daemon --continue --scan --info
- uses: ./.github/actions/setup-junit-report
find_gradle_jobs:
needs: [core]
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-build
- 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: |
set -euo pipefail
MATRIX_FILE="$RUNNER_TEMP/test-matrix.json"
./gradlew --no-daemon --parallel -q testMatrix -PtestMatrixOutput="$MATRIX_FILE"
TASKS=$(jq --compact-output --exit-status '
if type == "array" and length > 0 and all(.[]; type == "string" and startswith(":"))
then map(select(. != ":testcontainers:check" and (startswith(":docs:") | not)))
else error("testMatrix output must be a non-empty array of Gradle task paths")
end
| if length > 0 then . else error("testMatrix produced no core Gradle tasks") end
' "$MATRIX_FILE")
echo "$TASKS"
printf 'matrix={"gradle_args":%s}\n' "$TASKS" >> "$GITHUB_OUTPUT"
check:
needs: [find_gradle_jobs]
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.find_gradle_jobs.outputs.matrix) }}
runs-on: ubuntu-22.04
permissions:
checks: write
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-build
- name: Build and test with Gradle (${{matrix.gradle_args}})
run: |
./gradlew --no-daemon --continue --scan ${{matrix.gradle_args}}
- uses: ./.github/actions/setup-junit-report
find_examples_jobs:
needs: [check]
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-build
- 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: |
set -euo pipefail
MATRIX_FILE="$RUNNER_TEMP/examples-test-matrix.json"
./gradlew --no-daemon --parallel -q testMatrix -PtestMatrixOutput="$MATRIX_FILE"
TASKS=$(jq --compact-output --exit-status '
if type == "array" and length > 0 and all(.[]; type == "string" and startswith(":"))
then .
else error("testMatrix output must be a non-empty array of Gradle task paths")
end
' "$MATRIX_FILE")
echo "$TASKS"
printf 'matrix={"gradle_args":%s}\n' "$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
permissions:
checks: write
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-build
- name: Build and test Examples with Gradle (${{matrix.gradle_args}})
working-directory: ./examples/
run: |
./gradlew --no-daemon --continue --scan --info ${{matrix.gradle_args}}
- uses: ./.github/actions/setup-junit-report
find_docs_examples_jobs:
needs: [check_examples]
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-build
- 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: |
set -euo pipefail
MATRIX_FILE="$RUNNER_TEMP/docs-test-matrix.json"
./gradlew --no-daemon --parallel -q testMatrix -PtestMatrixOutput="$MATRIX_FILE"
TASKS=$(jq --compact-output --exit-status '
if type == "array" and length > 0 and all(.[]; type == "string" and startswith(":"))
then map(select(startswith(":docs:")))
else error("testMatrix output must be a non-empty array of Gradle task paths")
end
| if length > 0 then . else error("testMatrix produced no docs Gradle tasks") end
' "$MATRIX_FILE")
echo "$TASKS"
printf 'matrix={"gradle_args":%s}\n' "$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
permissions:
checks: write
steps:
- uses: actions/checkout@v7
- uses: ./.github/actions/setup-build
- name: Build and test with Gradle (${{matrix.gradle_args}})
run: |
./gradlew --no-daemon --continue --scan ${{matrix.gradle_args}}
- uses: ./.github/actions/setup-junit-report