-
Notifications
You must be signed in to change notification settings - Fork 2
143 lines (125 loc) · 3.64 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
name: CI
on:
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: true
jobs:
build-all:
runs-on: macos-latest
steps:
- name: check out
uses: actions/checkout@v3
- name: main build
uses: ./.github/actions/gradle-task
with:
task: jar compileKotlin
write-cache-key: main-build-artifacts
ktlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: ktlint
uses: ./.github/actions/gradle-task-with-commit
with:
personal-access-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fix-task: ktlintFormat
check-task: ktlintCheck
dependency-guard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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
steps:
- uses: actions/checkout@v3
- name: moduleCheck
uses: ./.github/actions/gradle-task-with-commit
with:
personal-access-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fix-task: moduleCheckAuto
check-task: moduleCheck
check-version-is-snapshot:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: check version is snapshot
uses: ./.github/actions/gradle-task
with:
task: checkVersionIsSnapshot
detekt:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- 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@v2
if: success() || failure()
with:
sarif_file: build/reports/detekt/merged.sarif
api-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: api-check
uses: ./.github/actions/gradle-task-with-commit
with:
personal-access-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
fix-task: apiDump
check-task: apiCheck
unit-tests:
strategy:
fail-fast: false
matrix:
runner: [ ubuntu, windows ]
runs-on: ${{ matrix.runner }}-latest
steps:
- name: check out
uses: actions/checkout@v3
- name: unit tests
uses: ./.github/actions/gradle-task
with:
task: test
restore-cache-key: main-build-artifacts
- name: Archive test results
uses: actions/upload-artifact@v3
if: failure()
with:
name: test-results
path: ${{ github.workspace }}/**/build/reports/tests/
- name: Unit test results
uses: mikepenz/action-junit-report@v3
if: failure()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: '**/build/**/TEST-*.xml'
check_name: Unit Test Results - ${{runner.os}}
all-checks:
if: always()
runs-on: ubuntu-latest
needs:
- api-check
- check-version-is-snapshot
- dependency-guard
- detekt
- ktlint
- moduleCheck
- unit-tests
steps:
- name: require that all other jobs have passed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}