-
Notifications
You must be signed in to change notification settings - Fork 7
376 lines (335 loc) · 12.9 KB
/
ci.yml
File metadata and controls
376 lines (335 loc) · 12.9 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
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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6 # 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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: main build
uses: rickbusarow/actions/gradle-task@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Create GitHub App Token
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2
id: app-token
with:
app-id: ${{ secrets.PR_BOT_APP_ID }}
private-key: ${{ secrets.PR_BOT_PRIVATE_KEY }}
- name: ktlint
uses: rickbusarow/actions/gradle-task-with-commit@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
with:
personal-access-token: ${{ steps.app-token.outputs.token }}
fix-task: ktlintFormat
check-task: ktlintCheck
ci-matrices:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Create GitHub App Token
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2
id: app-token
with:
app-id: ${{ secrets.PR_BOT_APP_ID }}
private-key: ${{ secrets.PR_BOT_PRIVATE_KEY }}
- name: ci-matrices
uses: rickbusarow/actions/gradle-task-with-commit@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
with:
personal-access-token: ${{ steps.app-token.outputs.token }}
fix-task: versionsMatrixYamlUpdate unitTestShardMatrixYamlUpdate
check-task: versionsMatrixYamlCheck unitTestShardMatrixYamlCheck
dependency-guard:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Create GitHub App Token
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2
id: app-token
with:
app-id: ${{ secrets.PR_BOT_APP_ID }}
private-key: ${{ secrets.PR_BOT_PRIVATE_KEY }}
- name: dependency-guard
uses: rickbusarow/actions/gradle-task-with-commit@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
with:
personal-access-token: ${{ steps.app-token.outputs.token }}
fix-task: dependencyGuardBaseline --no-parallel
check-task: dependencyGuard --no-parallel
# moduleCheck:
# runs-on: ubuntu-latest
# needs: build-all
# steps:
# - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
# - name: Create GitHub App Token
# uses: actions/create-github-app-token@136412a57a7081aa63c935a2cc2918f76c34f514 # v1
# id: app-token
# with:
# app-id: ${{ secrets.PR_BOT_APP_ID }}
# private-key: ${{ secrets.PR_BOT_PRIVATE_KEY }}
#
# - name: moduleCheck
# uses: rickbusarow/actions/gradle-task-with-commit@bf0940965387f10bcb8b6699a79499d18167dfbe # v1
# with:
# personal-access-token: ${{ steps.app-token.outputs.token }}
# fix-task: moduleCheckAuto
# check-task: moduleCheck
doks:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Create GitHub App Token
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2
id: app-token
with:
app-id: ${{ secrets.PR_BOT_APP_ID }}
private-key: ${{ secrets.PR_BOT_PRIVATE_KEY }}
- name: doks
uses: rickbusarow/actions/gradle-task-with-commit@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
with:
personal-access-token: ${{ steps.app-token.outputs.token }}
fix-task: doks
check-task: doksCheck
website-versioning:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Create GitHub App Token
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2
id: app-token
with:
app-id: ${{ secrets.PR_BOT_APP_ID }}
private-key: ${{ secrets.PR_BOT_PRIVATE_KEY }}
- name: website versioning
uses: rickbusarow/actions/gradle-task-with-commit@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
with:
personal-access-token: ${{ steps.app-token.outputs.token }}
fix-task: updateWebsiteNextDocsVersionRefs updateWebsitePackageJsonVersion updateWebsiteChangelog
check-task: checkWebsiteNextDocsVersionRefs checkWebsitePackageJsonVersion
artifacts-check:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: Create GitHub App Token
uses: actions/create-github-app-token@a8d616148505b5069dccd32f177bb87d7f39123b # v2
id: app-token
with:
app-id: ${{ secrets.PR_BOT_APP_ID }}
private-key: ${{ secrets.PR_BOT_PRIVATE_KEY }}
- name: artifacts-check
uses: rickbusarow/actions/gradle-task-with-commit@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
with:
personal-access-token: ${{ steps.app-token.outputs.token }}
fix-task: artifactsDump
check-task: artifactsCheck
check-version-is-snapshot:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: check version is snapshot
uses: rickbusarow/actions/gradle-task@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
with:
task: checkVersionIsSnapshot
detekt:
runs-on: ubuntu-latest
needs: build-all
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: detektAll
uses: rickbusarow/actions/gradle-task@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
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@96f518a34f7a870018057716cc4d7a5c014bd61c # 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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: dokkaGenerate
uses: rickbusarow/actions/gradle-task@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
with:
task: dokkaGenerate
restore-cache-key: main-build-artifacts
write-cache-key: dokka-build-artifacts
- name: website build cache
uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4
with:
path: |
website/.docusaurus
website/build
website/node_modules
key: website-build
enableCrossOsArchive: true
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4
with:
version: 8
# Node is required for pnpm
- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # 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: rickbusarow/actions/gradle-task@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: unit tests
uses: rickbusarow/actions/gradle-task@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
with:
task: testShard${{ matrix.shardNum }}
restore-cache-key: main-build-artifacts
- name: Archive test results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: failure()
with:
name: test-results
path: ${{ github.workspace }}/**/build/reports/tests/
- name: Unit test results
uses: mikepenz/action-junit-report@3585e9575db828022551b4231f165eb59a0e74e3 # v5
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: [ 2.0.21 ]
gradle-version: [ 8.6, 8.11.1, 8.14 ]
agp-version: [ 8.4.0, 8.10.0 ]
anvil-version: [ 2.5.0, 2.5.1 ]
exclude:
- kotlin-version: 2.0.21
anvil-version: 2.5.0
- gradle-version: 8.6
agp-version: 8.10.0
### <end-versions-matrix>
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: integration-tests
uses: rickbusarow/actions/gradle-task@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
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@3585e9575db828022551b4231f165eb59a0e74e3 # v5
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@08eba0b27e820071cde6df949e0beb9ba4906955 # v4
- name: integration-tests-windows
uses: rickbusarow/actions/gradle-task@c602f8da97f00279c6e77d3f25cbedcbf24ef936 # v1
with:
task: integrationTestShard${{ matrix.shardNum }} -Pmodulecheck.exhaustive=false
restore-cache-key: main-build-artifacts
- name: Archive integration test results
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: failure()
with:
name: integration-test-results-windows
path: ${{ github.workspace }}/**/build/reports/tests/
- name: Integration test results
uses: mikepenz/action-junit-report@3585e9575db828022551b4231f165eb59a0e74e3 # v5
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) }}