Repository navigation
300 lines (244 loc) · 7.46 KB
/
Copy pathci.yml
File metadata and controls
300 lines (244 loc) · 7.46 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
name: CI
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- feature/**
- bugfix/**
pull_request:
branches: [ develop, main ]
schedule:
- cron: '0 6 * * 1' # Every Monday 06:00 UTC — OWASP weekly scan
permissions:
contents: read
pull-requests: write
checks: write
jobs:
assemble:
name: Assemble
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: ${{ github.event_name != 'push' }}
- name: Run assemble
run: ./gradlew assemble --no-daemon
test:
name: Test
if: github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 20
needs: assemble
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: false
- name: Run unit tests
run: ./gradlew test jvmTest jsTest --no-daemon
- name: Upload test reports
if: always()
uses: actions/upload-artifact@v4
with:
name: test-reports-push
path: |
"**/build/reports/tests/"
"**/build/test-results/"
coverage:
name: Coverage & Verify
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 30
needs: assemble
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true
- name: Run coverage tasks (koverXmlReport + koverVerify)
run: ./gradlew test jvmTest jsTest koverXmlReport koverVerify --no-daemon
- name: Publish Test Report in PR
if: always()
uses: dorny/test-reporter@v1
with:
name: Kotlin Tests
path: "**/build/test-results/**/*.xml"
reporter: java-junit
- name: Comment coverage on PR
if: always()
uses: madrapps/jacoco-report@v1.7.1
with:
paths: ${{ github.workspace }}/build/reports/kover/report.xml
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
min-coverage-overall: 90
min-coverage-changed-files: 80
- name: Upload coverage artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: |
build/reports/kover/
"**/build/test-results/"
screenshot-test:
name: Screenshot Tests
if: github.event_name == 'pull_request'
runs-on: macos-latest
timeout-minutes: 30
needs: assemble
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true
- name: Detect web app changes
id: changes
uses: dorny/paths-filter@v3
with:
filters: |
webapp:
- 'app/webApp/**'
- name: Setup Node.js
if: steps.changes.outputs.webapp == 'true'
uses: actions/setup-node@v4
with:
node-version: 24.16.0
cache: npm
- name: Install dependencies
if: steps.changes.outputs.webapp == 'true'
working-directory: app/webApp
run: npm ci
- name: Install Playwright browsers
if: steps.changes.outputs.webapp == 'true'
working-directory: app/webApp
run: npx playwright install --with-deps
- name: Run Playwright screenshot tests
if: steps.changes.outputs.webapp == 'true'
working-directory: app/webApp
run: npx playwright test
- name: Upload Playwright HTML Report
if: always() && steps.changes.outputs.webapp == 'true'
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: app/webApp/playwright-report/
- name: Upload screenshot diffs
if: failure() && steps.changes.outputs.webapp == 'true'
uses: actions/upload-artifact@v4
with:
name: screenshot-diffs
path: |
app/webApp/test-results/
app/webApp/src/webTest/ts/screenshot/**/*-diff.png
benchmark:
name: Run Benchmark
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 30
needs: assemble
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true
- name: Run benchmarks (fast mode)
run: ./gradlew fastBenchmark benchmarkMerge -PbenchmarkConfig=fast --no-daemon
- name: Compare and comment
uses: benchmark-action/github-action-benchmark@v1
with:
tool: 'jmh'
output-file-path: build/reports/benchmarks/benchmark-results.json
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
auto-push: true
alert-threshold: '120%'
comment-on-alert: true
fail-on-alert: true
gh-pages-branch: 'gh-pages'
detekt:
name: Detekt
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 20
needs: assemble
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true
- name: Run detekt
run: ./gradlew detekt --no-daemon
- name: Upload detekt reports
if: always()
uses: actions/upload-artifact@v4
with:
name: detekt-report
path: "**/build/reports/detekt/"
secret-scan:
name: Secret Scan (Gitleaks)
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
dependency-check:
name: OWASP Dependency Check
# Run on PRs to main (security gate) and on weekly schedule
if: >
(github.event_name == 'pull_request' && github.base_ref == 'main') ||
github.event_name == 'schedule'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: gradle/actions/setup-gradle@v4
with:
# Cache the NVD database between runs to speed up subsequent scans
cache-read-only: false
- name: Run OWASP Dependency Check
run: ./gradlew dependencyCheckAggregate -PnvdApiKey=${{ secrets.NVD_API_KEY }} --no-daemon
- name: Upload OWASP report
if: always()
uses: actions/upload-artifact@v4
with:
name: dependency-check-report
path: build/reports/dependency-check-report/