-
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (77 loc) · 2.45 KB
/
test-branch.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
name: Test Branch
on:
pull_request:
branches:
- 'dev/**'
paths:
- '**.java'
- '**.kt'
- '**.kts'
- '*/src/*/kotlin/**'
- '*/src/*/java/**'
- '*/src/*/resource/**'
- 'gradle/**'
concurrency:
group: '${{ github.workflow }}-${{ github.ref }}'
cancel-in-progress: true
env:
IS_CI: true
GRADLE_OPTS: "-Dfile.encoding=UTF-8"
jobs:
build-test:
name: Build and test
strategy:
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
cache: 'gradle'
- name: Set up gradle
uses: gradle/actions/setup-gradle@v3
with:
add-job-summary-as-pr-comment: on-failure # Valid values are 'never' (default), 'always', and 'on-failure'
- name: Run All Tests
run: gradle assemble allTests "-Porg.gradle.jvmargs='-Xmx4g -Xms2g -XX:MaxMetaspaceSize=1g -Dfile.encoding=UTF-8'" --info --warning-mode all --build-cache
- name: Upload test reports
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-reports-${{ runner.os }}
path: '**/build/reports/tests'
retention-days: 7
detekt-check:
name: Detekt check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 21
cache: 'gradle'
- name: Set up gradle
uses: gradle/actions/setup-gradle@v3
with:
add-job-summary-as-pr-comment: on-failure # Valid values are 'never' (default), 'always', and 'on-failure'
- name: Run detekt
run: gradle detekt
- name: Upload detekt reports
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: detekt-reports
path: 'build/reports/detekt'
retention-days: 7
# https://detekt.dev/docs/introduction/reporting/#integration-with-github-code-scanning
# Make sure we always run this upload task,
# because the previous step may fail if there are findings.
- name: Upload SARIF to GitHub using the upload-sarif action
uses: github/codeql-action/upload-sarif@v2
if: ${{ always() }}
with:
sarif_file: 'build/reports/detekt/detekt.sarif'