-
Notifications
You must be signed in to change notification settings - Fork 1.6k
395 lines (389 loc) · 14.3 KB
/
build.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
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
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
name: build
permissions: read-all
on: [ push, pull_request ]
env:
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
ALLOWED_ENDPOINTS: >
1k4dacprodeus2file4.blob.core.windows.net:443
api.adoptium.net
api.github.com:443
artifactcache.actions.githubusercontent.com:443
caffeine.gradle-enterprise.cloud:443
cdn.azul.com:443
cloudflare.com:443
downloads.gradle-dn.com:443
ghcr.io:443
github.com:443
objects.githubusercontent.com:443
oss.sonatype.org:443
pipelines.actions.githubusercontent.com:443
plugins.gradle.org:443
plugins-artifacts.gradle.org:443
registry.npmjs.org:443
repo.gradle.org:443
repo.maven.apache.org:443
repo1.maven.org:443
scans-in.gradle.com:443
services.gradle.org:443
MIN_JVM: 11
MAX_JVM: 18
jobs:
compile:
name: Compile
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 11, 18 ]
env:
JAVA_VERSION: ${{ matrix.java }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@dd2c410b088af7c0dc8046f3ac9a8f4148492a95
with:
egress-policy: block
allowed-endpoints: ${{ env.ALLOWED_ENDPOINTS }}
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: Wandalen/wretry.action@v1.0.20
timeout-minutes: 5
with:
action: actions/setup-java@v3
with: |
distribution: temurin
java-version: ${{ matrix.java }}
attempt_limit: 3
attempt_delay: 2000
- name: Setup Gradle
uses: Wandalen/wretry.action@v1.0.20
timeout-minutes: 5
with:
action: gradle/gradle-build-action@v2
with: |
cache-read-only: false
arguments: help --no-scan
generate-job-summary: false
gradle-home-cache-strict-match: true
attempt_limit: 3
attempt_delay: 2000
- name: Compile
run: |
stopMarker=$(uuidgen)
echo "::stop-commands::$stopMarker"
trap "echo '::$stopMarker::'" EXIT
./gradlew check -x test
- name: Cancel if failed
uses: andymckay/cancel-action@0.2
continue-on-error: true
if: failure()
tests:
name: Tests
runs-on: ubuntu-latest
needs: compile
strategy:
matrix:
suite:
- caffeine:weakKeysAndStrongValuesStatsAsyncCaffeineSlowTest
- caffeine:weakKeysAndStrongValuesStatsSyncCaffeineSlowTest
- caffeine:strongKeysAndWeakValuesStatsSyncCaffeineSlowTest
- caffeine:strongKeysAndSoftValuesStatsSyncCaffeineSlowTest
- caffeine:strongKeysAndStrongValuesStatsAsyncCaffeineTest
- caffeine:weakKeysAndWeakValuesStatsSyncCaffeineSlowTest
- caffeine:weakKeysAndSoftValuesStatsSyncCaffeineSlowTest
- caffeine:strongKeysAndStrongValuesStatsSyncCaffeineTest
- caffeine:weakKeysAndStrongValuesStatsSyncGuavaSlowTest
- caffeine:weakKeysAndStrongValuesStatsAsyncCaffeineTest
- caffeine:strongKeysAndWeakValuesStatsSyncGuavaSlowTest
- caffeine:strongKeysAndSoftValuesStatsSyncGuavaSlowTest
- caffeine:weakKeysAndStrongValuesStatsSyncCaffeineTest
- caffeine:weakKeysAndStrongValuesAsyncCaffeineSlowTest
- caffeine:strongKeysAndWeakValuesStatsSyncCaffeineTest
- caffeine:strongKeysAndSoftValuesStatsSyncCaffeineTest
- caffeine:weakKeysAndWeakValuesStatsSyncGuavaSlowTest
- caffeine:weakKeysAndStrongValuesSyncCaffeineSlowTest
- caffeine:weakKeysAndSoftValuesStatsSyncGuavaSlowTest
- caffeine:strongKeysAndWeakValuesSyncCaffeineSlowTest
- caffeine:strongKeysAndStrongValuesStatsSyncGuavaTest
- caffeine:strongKeysAndSoftValuesSyncCaffeineSlowTest
- caffeine:weakKeysAndWeakValuesStatsSyncCaffeineTest
- caffeine:weakKeysAndSoftValuesStatsSyncCaffeineTest
- caffeine:strongKeysAndStrongValuesAsyncCaffeineTest
- caffeine:weakKeysAndWeakValuesSyncCaffeineSlowTest
- caffeine:weakKeysAndStrongValuesStatsSyncGuavaTest
- caffeine:weakKeysAndSoftValuesSyncCaffeineSlowTest
- caffeine:strongKeysAndWeakValuesStatsSyncGuavaTest
- caffeine:strongKeysAndStrongValuesSyncCaffeineTest
- caffeine:strongKeysAndSoftValuesStatsSyncGuavaTest
- caffeine:weakKeysAndStrongValuesSyncGuavaSlowTest
- caffeine:weakKeysAndStrongValuesAsyncCaffeineTest
- caffeine:strongKeysAndWeakValuesSyncGuavaSlowTest
- caffeine:strongKeysAndSoftValuesSyncGuavaSlowTest
- caffeine:weakKeysAndWeakValuesStatsSyncGuavaTest
- caffeine:weakKeysAndStrongValuesSyncCaffeineTest
- caffeine:weakKeysAndSoftValuesStatsSyncGuavaTest
- caffeine:strongKeysAndWeakValuesSyncCaffeineTest
- caffeine:strongKeysAndSoftValuesSyncCaffeineTest
- caffeine:weakKeysAndWeakValuesSyncGuavaSlowTest
- caffeine:weakKeysAndSoftValuesSyncGuavaSlowTest
- caffeine:strongKeysAndStrongValuesSyncGuavaTest
- caffeine:weakKeysAndWeakValuesSyncCaffeineTest
- caffeine:weakKeysAndSoftValuesSyncCaffeineTest
- caffeine:weakKeysAndStrongValuesSyncGuavaTest
- caffeine:strongKeysAndWeakValuesSyncGuavaTest
- caffeine:strongKeysAndSoftValuesSyncGuavaTest
- caffeine:weakKeysAndWeakValuesSyncGuavaTest
- caffeine:weakKeysAndSoftValuesSyncGuavaTest
- caffeine:lincheckTest
- caffeine:isolatedTest
- caffeine:junitTest
- simulator:check
- jcache:check
- guava:check
java: [ 11, 18 ]
env:
JAVA_VERSION: ${{ matrix.java }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@dd2c410b088af7c0dc8046f3ac9a8f4148492a95
with:
egress-policy: block
allowed-endpoints: ${{ env.ALLOWED_ENDPOINTS }}
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: Wandalen/wretry.action@v1.0.20
timeout-minutes: 5
with:
action: actions/setup-java@v3
with: |
distribution: temurin
java-version: ${{ matrix.java }}
attempt_limit: 3
attempt_delay: 2000
- name: Setup Gradle
uses: Wandalen/wretry.action@v1.0.20
timeout-minutes: 5
with:
action: gradle/gradle-build-action@v2
with: |
cache-read-only: false
arguments: help --no-scan
generate-job-summary: false
gradle-home-cache-strict-match: true
attempt_limit: 3
attempt_delay: 2000
- name: Run tests (${{ matrix.suite }})
run: |
stopMarker=$(uuidgen)
echo "::stop-commands::$stopMarker"
trap "echo '::$stopMarker::'" EXIT
./gradlew ${{ matrix.suite }}
- name: Format Test Artifact Name
if: always() && (matrix.java == env.MAX_JVM)
run: |
RAW_NAME=${{ matrix.suite }}-${{ matrix.java }}
ARTIFACT_NAME=$(echo $RAW_NAME | sed 's/:/-/g')
echo "ARTIFACT_NAME=$ARTIFACT_NAME" >> $GITHUB_ENV
- name: Compress test results
uses: sibiraj-s/action-archiver@v1
if: always() && (matrix.java == env.MAX_JVM)
with:
path: '**/{jacoco,results}/**/*.{exec,xml}'
output: ${{ env.ARTIFACT_NAME }}.tar.gz
format: tar
gzip: true
- name: Upload test results
uses: actions/upload-artifact@v3
if: always() && (matrix.java == env.MAX_JVM)
with:
retention-days: 1
name: ${{ env.ARTIFACT_NAME }}-results
path: ${{ env.ARTIFACT_NAME }}.tar.gz
- name: Cancel if failed
uses: andymckay/cancel-action@0.2
continue-on-error: true
if: failure()
coverage:
name: Coverage
runs-on: ubuntu-latest
needs: tests
if: github.event_name == 'push'
steps:
- name: Harden Runner
uses: step-security/harden-runner@dd2c410b088af7c0dc8046f3ac9a8f4148492a95
with:
egress-policy: block
allowed-endpoints: >
${{ env.ALLOWED_ENDPOINTS }}
artifacts.codacy.com:443
api.codacy.com:443
codecov.io:443
coveralls.io:443
fastly.com:443
nodejs.org:443
raw.githubusercontent.com
sonarcloud.io:443
scanner.sonarcloud.io:443
storage.googleapis.com:443
uploader.codecov.io:443
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK ${{ env.MAX_JVM }}
uses: Wandalen/wretry.action@v1.0.20
with:
action: actions/setup-java@v3
with: |
distribution: temurin
java-version: ${{ env.MAX_JVM }}
attempt_limit: 3
attempt_delay: 2000
- name: Setup Gradle
uses: Wandalen/wretry.action@v1.0.20
timeout-minutes: 5
with:
action: gradle/gradle-build-action@v2
with: |
cache-read-only: false
generate-job-summary: false
arguments: help --daemon --no-scan
attempt_limit: 3
attempt_delay: 2000
- name: Download Tests Results
uses: actions/download-artifact@v3
- name: Decompress
run: find . -type f -name '*.tar.gz' -exec sh -c 'tar -zxf {} --one-top-level' \;
- name: Combine Jacoco Reports
env:
JAVA_VERSION: ${{ env.MAX_JVM }}
run: |
stopMarker=$(uuidgen)
echo "::stop-commands::$stopMarker"
trap "echo '::$stopMarker::'" EXIT
./gradlew --daemon jacocoFullReport
- name: Publish to Coveralls
env:
JAVA_VERSION: ${{ env.MAX_JVM }}
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
stopMarker=$(uuidgen)
echo "::stop-commands::$stopMarker"
trap "echo '::$stopMarker::'" EXIT
./gradlew --daemon coveralls
continue-on-error: true
- name: Publish to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Publish to Codacy
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
continue-on-error: true
- name: Publish to SonarQube
env:
JAVA_VERSION: ${{ env.MAX_JVM }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
stopMarker=$(uuidgen)
echo "::stop-commands::$stopMarker"
trap "echo '::$stopMarker::'" EXIT
./gradlew --daemon sonarqube -Dsonar.branch.name=${GITHUB_REF##*/}
continue-on-error: true
test-results:
name: Test Results
runs-on: ubuntu-latest
needs: tests
permissions:
checks: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@dd2c410b088af7c0dc8046f3ac9a8f4148492a95
with:
egress-policy: block
allowed-endpoints: ${{ env.ALLOWED_ENDPOINTS }}
- name: Download Tests
uses: actions/download-artifact@v3
- name: Decompress
run: find . -type f -name '*.tar.gz' -exec sh -c 'tar -zxf {} --one-top-level' \;
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
continue-on-error: true
id: test-results
with:
json_thousands_separator: ','
junit_files: '**/TEST-*.xml'
comment_mode: off
ignore_runs: true
job_summary: true
- name: Create badge
uses: emibcn/badge-action@d6f51ff11b5c3382b3b88689ae2d6db22d9737d1
with:
label: tests
color: 31c653
path: badge.svg
status: ${{ fromJSON(steps.test-results.outputs.json).formatted.stats.runs }}
- name: Upload badge to Gist
uses: andymckay/append-gist-action@88823092589111fc0683e670da60e941b29f94e9
if: >
github.event_name == 'push'
&& endsWith(github.ref, github.event.repository.default_branch)
with:
gistURL: https://gist.githubusercontent.com/ben-manes/c20eb418f0e0bd6dfe1c25beb35faae4
token: ${{ secrets.GIST_TOKEN }}
file: badge.svg
publish-snapshot:
name: Publish Snapshot
runs-on: ubuntu-latest
needs: tests
if: >
github.event_name == 'push'
&& endsWith(github.ref, github.event.repository.default_branch)
steps:
- name: Harden Runner
uses: step-security/harden-runner@dd2c410b088af7c0dc8046f3ac9a8f4148492a95
with:
egress-policy: block
allowed-endpoints: >
${{ env.ALLOWED_ENDPOINTS }}
checkerframework.org:443
docs.oracle.com:443
lightbend.github.io:443
guava.dev:443
- uses: actions/checkout@v3
- name: Set up JDK ${{ env.MIN_JVM }}
uses: Wandalen/wretry.action@v1.0.20
with:
action: actions/setup-java@v3
with: |
distribution: temurin
java-version: ${{ env.MIN_JVM }}
attempt_limit: 3
attempt_delay: 2000
- name: Setup Gradle
uses: Wandalen/wretry.action@v1.0.20
timeout-minutes: 5
with:
action: gradle/gradle-build-action@v2
with: |
cache-read-only: false
arguments: help --no-scan
generate-job-summary: false
attempt_limit: 3
attempt_delay: 2000
- name: Publish Snapshot
env:
JAVA_VERSION: ${{ env.MIN_JVM }}
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingKeyId: 20BCF6B1
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
run: |
stopMarker=$(uuidgen)
echo "::stop-commands::$stopMarker"
trap "echo '::$stopMarker::'" EXIT
./gradlew publishToSonatype