-
Notifications
You must be signed in to change notification settings - Fork 7
329 lines (294 loc) · 10.2 KB
/
ci.yml
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
name: CI
on:
pull_request:
workflow_dispatch:
jobs:
cancel-previous-runs:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa # 0.12.1
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
validate-wrapper:
runs-on: ubuntu-latest
steps:
- name: check out
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: gradle/wrapper-validation-action@88425854a36845f9c881450d9660b5fd46bee142 # v3
build-all:
needs: validate-wrapper
strategy:
fail-fast: false
matrix:
runner: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.runner }}
steps:
- name: check out
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: main build
uses: ./.github/actions/gradle-task
with:
task: jar compileKotlin
write-cache-key: main-build-artifacts
restore-cache-key: build-logic-artifacts
ktlint:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: ktlint
uses: ./.github/actions/gradle-task-with-commit
with:
personal-access-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fix-task: ktlintFormat
check-task: ktlintCheck
ci-matrices:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: ci-matrices
uses: ./.github/actions/gradle-task-with-commit
with:
personal-access-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fix-task: versionsMatrixYamlUpdate unitTestShardMatrixYamlUpdate
check-task: versionsMatrixYamlCheck unitTestShardMatrixYamlCheck
dependency-guard:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: dependency-guard
uses: ./.github/actions/gradle-task-with-commit
with:
personal-access-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fix-task: dependencyGuardBaseline
check-task: dependencyGuard
moduleCheck:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: moduleCheck
uses: ./.github/actions/gradle-task-with-commit
with:
personal-access-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fix-task: moduleCheckAuto
check-task: moduleCheck
doks:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: doks
uses: ./.github/actions/gradle-task-with-commit
with:
personal-access-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fix-task: doks
check-task: doksCheck
website-versioning:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: website versioning
uses: ./.github/actions/gradle-task-with-commit
with:
personal-access-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fix-task: updateWebsiteNextDocsVersionRefs updateWebsitePackageJsonVersion updateWebsiteChangelog
check-task: checkWebsiteNextDocsVersionRefs checkWebsitePackageJsonVersion
artifacts-check:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: artifacts-check
uses: ./.github/actions/gradle-task-with-commit
with:
personal-access-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fix-task: artifactsDump
check-task: artifactsCheck
check-version-is-snapshot:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: check version is snapshot
uses: ./.github/actions/gradle-task
with:
task: checkVersionIsSnapshot
detekt:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: detektAll
uses: ./.github/actions/gradle-task
with:
task: detektAll
restore-cache-key: main-build-artifacts
- name: merge detekt SARIF reports
run: ./gradlew detektReportMerge
- name: Upload SARIF to Github using the upload-sarif action
uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3
if: success() || failure()
with:
sarif_file: build/reports/detekt/merged.sarif
build-website:
runs-on: ubuntu-latest
needs: build-all
steps:
- name: check out
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: dokkaHtmlMultiModule
uses: ./.github/actions/gradle-task
with:
task: dokkaHtmlMultiModule
restore-cache-key: main-build-artifacts
write-cache-key: dokka-build-artifacts
- name: website build cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
with:
path: |
website/.docusaurus
website/build
website/node_modules
key: website-build
enableCrossOsArchive: true
- uses: pnpm/action-setup@v2
with:
version: 8
# Node is required for pnpm
- name: Set up Node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4
with:
node-version: 18
cache: pnpm
cache-dependency-path: website/pnpm-lock.yaml
- name: Install Pnpm
working-directory: website
run: pnpm install --no-lockfile
- name: build website
uses: ./.github/actions/gradle-task
with:
task: buildSite
write-cache-key: website-build
- name: knit check
run: ./gradlew knitCheck
unit-tests:
needs: build-all
strategy:
fail-fast: false
matrix:
runner: [ ubuntu, windows ]
### <start-unit-test-shards>
shardNum: [ 1, 2, 3, 4 ]
### <end-unit-test-shards>
runs-on: ${{ matrix.runner }}-latest
steps:
- name: check out
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: unit tests
uses: ./.github/actions/gradle-task
with:
task: testShard${{ matrix.shardNum }}
restore-cache-key: main-build-artifacts
- name: Archive test results
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
if: failure()
with:
name: test-results
path: ${{ github.workspace }}/**/build/reports/tests/
- name: Unit test results
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
if: failure()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/**/TEST-*.xml'
check_name: Unit Test Results - ${{runner.os}}
integration-tests-ubuntu:
needs: build-all
strategy:
fail-fast: false
### <start-versions-matrix>
matrix:
kotlin-version: [ 1.9.22 ]
gradle-version: [ 8.5, 8.6 ]
agp-version: [ 8.0.2, 8.1.0 ]
anvil-version: [ 2.4.9 ]
exclude: [ ]
### <end-versions-matrix>
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: integration-tests
uses: ./.github/actions/gradle-task
with:
task: |
integrationTest
-Pmodulecheck.gradleVersion=${{ matrix.gradle-version }}
-Pmodulecheck.agpVersion=${{ matrix.agp-version }}
-Pmodulecheck.kotlinVersion=${{ matrix.kotlin-version }}
-Pmodulecheck.anvilVersion=${{ matrix.anvil-version }}
-Pmodulecheck.exhaustive=false
restore-cache-key: main-build-artifacts
- name: Unit test results
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
if: failure()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/**/TEST-*.xml'
check_name: Integration Test Results
integration-tests-windows:
needs: build-all
strategy:
fail-fast: false
matrix:
### <start-integration-test-shards>
shardNum: [ 1, 2, 3, 4, 5, 6 ]
### <end-integration-test-shards>
runs-on: windows-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: integration-tests-windows
uses: ./.github/actions/gradle-task
with:
task: integrationTestShard${{ matrix.shardNum }} -Pmodulecheck.exhaustive=false
restore-cache-key: main-build-artifacts
- name: Archive integration test results
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
if: failure()
with:
name: integration-test-results-windows
path: ${{ github.workspace }}/**/build/reports/tests/
- name: Integration test results
uses: mikepenz/action-junit-report@db71d41eb79864e25ab0337e395c352e84523afe # v4
if: failure()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/**/TEST-*.xml'
check_name: Integration Test Results - Windows
all-checks:
if: always()
runs-on: ubuntu-latest
needs:
- artifacts-check
- build-website
- check-version-is-snapshot
- ci-matrices
- dependency-guard
- detekt
- doks
- integration-tests-ubuntu
- integration-tests-windows
- ktlint
- moduleCheck
- unit-tests
- validate-wrapper
- website-versioning
steps:
- name: require that all other jobs have passed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
with:
jobs: ${{ toJSON(needs) }}