-
Notifications
You must be signed in to change notification settings - Fork 2
246 lines (209 loc) · 6.62 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
name: "Build"
on:
push:
branches:
- main
- develop
- issues/**
- renovate/**
jobs:
staticDetektCheck:
name: "Detekt - static check"
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '21'
- name: "Check out sources"
uses: actions/[email protected]
- name: "Detekt"
uses: burrunan/gradle-cache-action@v2
with:
remote-build-cache-proxy-enabled: false
save-local-build-cache: false
arguments: detekt
- name: "Upload sarif report"
uses: github/codeql-action/upload-sarif@v3
if: success() || failure()
with:
sarif_file: build/reports/detekt/detekt.sarif
category: detekt
- name: "Upload detekt report"
uses: actions/[email protected]
if: success() || failure()
with:
name: detektReport
path: build/reports/detekt
licenceCheck:
name: "Fossa licence analyze - static check"
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '21'
- name: "Check out sources"
uses: actions/[email protected]
- name: "Fossa analyze"
uses: fossas/fossa-action@v1
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
- name: "Fossa test"
uses: fossas/fossa-action@v1
with:
api-key: ${{ secrets.FOSSA_API_KEY }}
run-tests: true
compile:
runs-on: ubuntu-latest
name: "Build artifact"
steps:
- uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '21'
- name: "Check out sources"
uses: actions/[email protected]
- name: "Compile"
uses: burrunan/gradle-cache-action@v2
with:
remote-build-cache-proxy-enabled: false
arguments: jar
validatePlugin:
runs-on: ubuntu-latest
needs: compile
steps:
- uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '21'
- name: "Check out sources"
uses: actions/[email protected]
- name: "Validate plugin"
uses: burrunan/gradle-cache-action@v2
with:
remote-build-cache-proxy-enabled: false
arguments: validatePlugins
unitTest:
runs-on: ubuntu-latest
needs: compile
steps:
- uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '21'
- name: "Check out sources"
uses: actions/[email protected]
- name: "Unit test coverage cache"
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/build/jacoco/**
key: ${{ runner.os }}-jacoco-unitTest-${{ github.run_id }}
- name: "Unit test"
uses: burrunan/gradle-cache-action@v2
with:
remote-build-cache-proxy-enabled: false
save-local-build-cache: false
arguments: test
- name: "Publish Unit Test Results"
uses: EnricoMi/[email protected]
if: always()
with:
check_name: "Unit test results"
junit_files: build/test-results/**/*.xml
- name: "Upload unit test report"
uses: actions/[email protected]
if: always()
with:
name: unitTestReport
path: build/reports/tests/test
functionalTest:
runs-on: ubuntu-latest
needs: compile
steps:
- uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '21'
- name: "Check out sources"
uses: actions/[email protected]
- name: "Functional test coverage cache"
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/build/jacoco/**
key: ${{ runner.os }}-jacoco-functionalTest-${{ github.run_id }}
- name: "Execute Functional tests"
uses: burrunan/gradle-cache-action@v2
with:
remote-build-cache-proxy-enabled: false
save-local-build-cache: false
arguments: functionalTest
- name: "Publish functional test results"
uses: EnricoMi/[email protected]
if: always()
with:
check_name: "Functional test results"
junit_files: build/test-results/functionalTest/*.xml
- name: "Upload functional test report"
uses: actions/[email protected]
if: always()
with:
name: functionalTestReport
path: build/reports/tests/functionalTest
report:
runs-on: ubuntu-latest
needs:
- unitTest
- functionalTest
steps:
- name: "Check out sources"
uses: actions/[email protected]
- name: "Load unit test coverage cache"
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/build/jacoco/**
key: ${{ runner.os }}-jacoco-unitTest-${{ github.run_id }}
- name: "Load functional test coverage cache"
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/build/jacoco/**
key: ${{ runner.os }}-jacoco-functionalTest-${{ github.run_id }}
- name: "Create coverage report"
uses: burrunan/gradle-cache-action@v2
with:
remote-build-cache-proxy-enabled: false
save-local-build-cache: false
arguments: jacocoAggregatedCoverageReport
- name: "Publish Report"
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
publishSnapshot:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
needs:
- report
- licenceCheck
steps:
- uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '21'
- name: "Check out sources"
uses: actions/[email protected]
- name: "Load compile cache"
uses: actions/[email protected]
with:
path: ${{ github.workspace }}/build/**
key: ${{ runner.os }}-compile-${{ github.run_id }}
- name: "Publish snapshot to github"
uses: burrunan/gradle-cache-action@v2
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ github.token }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MVN_CNTRL_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MVN_CNTRL_SECRET_KEY_PASS }}
with:
remote-build-cache-proxy-enabled: false
save-local-build-cache: false
arguments: publish