-
Notifications
You must be signed in to change notification settings - Fork 0
256 lines (256 loc) · 8.21 KB
/
develop-workflow.yaml
File metadata and controls
256 lines (256 loc) · 8.21 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
############## Created by de.microtema:github-workflow-maven-plugin ############
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# Files under .github/workflows folder are generated and should not be edited. #
################################################################################
name: 'GitHub Workflows Maven-Plugin'
on:
push:
branches:
- develop
env:
APP_NAME: "github-workflows-maven-plugin"
APP_DISPLAY_NAME: "GitHub Workflows Maven-Plugin"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}"
JAVA_VERSION: "1.8"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true\
\ -DdeployAtEnd=true"
CODE_PATHS: "*"
VERSION: "2.0.4"
jobs:
initialize:
name: Initialize
runs-on: [ ubuntu-latest ]
outputs:
code-changed: ${{ steps.code-changed.outputs.changed }}
steps:
- name: 'Checkout'
uses: actions/checkout@v3
with:
fetch-depth: 100
- uses: marceloprado/has-changed-path@v1
id: code-changed
with:
paths: ${{ env.CODE_PATHS }}
versioning:
name: Versioning
runs-on: [ ubuntu-latest ]
needs: [ initialize ]
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Java: Setup'
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.2
- name: 'Maven: versions:set'
run: |
mvn release:update-versions -DdevelopmentVersion=0.0.1-SNAPSHOT $MAVEN_CLI_OPTS
mvn versions:set -DnewVersion=$VERSION $MAVEN_CLI_OPTS
- name: 'Artifact: prepare'
run: |
mkdir -p artifact
cp pom.xml artifact/pom.xml
- name: 'Artifact: upload'
uses: actions/upload-artifact@v2
with:
name: pom-artifact
path: artifact/pom.xml
compile:
name: Compile
runs-on: [ ubuntu-latest ]
needs: [ versioning ]
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Java: Setup'
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.2
- name: 'Artifact: download'
if: 'false'
uses: actions/download-artifact@v2
with:
name: pom-artifact
- name: 'Maven: versions:set'
run: |
mvn release:update-versions -DdevelopmentVersion=0.0.1-SNAPSHOT $MAVEN_CLI_OPTS
mvn versions:set -DnewVersion=$VERSION $MAVEN_CLI_OPTS
- name: 'Maven: compile'
run: mvn compile $MAVEN_CLI_OPTS
security-check:
name: Security Check
runs-on: [ ubuntu-latest ]
needs: [ compile ]
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Java: Setup'
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.2
- name: 'Maven: dependency-check'
run: mvn dependency-check:help -P security -Ddownloader.quick.query.timestamp=false $MAVEN_CLI_OPTS
unit-test:
name: Unit Test
runs-on: [ ubuntu-latest ]
needs: [ compile ]
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Java: Setup'
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.2
- name: 'Artifact: download'
if: 'false'
uses: actions/download-artifact@v2
with:
name: pom-artifact
- name: 'Maven: versions:set'
run: |
mvn release:update-versions -DdevelopmentVersion=0.0.1-SNAPSHOT $MAVEN_CLI_OPTS
mvn versions:set -DnewVersion=$VERSION $MAVEN_CLI_OPTS
- name: 'Maven: test'
run: mvn test $MAVEN_CLI_OPTS
- name: 'Artifact: prepare'
run: |
mkdir -p artifact/target/surefire-reports
cp -r target/surefire-reports/* artifact/target/surefire-reports/
cp -r target/jacoco.exec artifact/target/surefire-reports/
- name: 'Test result'
uses: actions/upload-artifact@v2
with:
name: target-artifact
path: artifact
it-test:
name: Integration Test
runs-on: [ ubuntu-latest ]
needs: [ compile ]
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Java: Setup'
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.2
- name: 'Artifact: download'
if: 'false'
uses: actions/download-artifact@v2
with:
name: pom-artifact
- name: 'Maven: integration-test'
run: mvn integration-test -P it -DtestType=IT -DsourceType=it $MAVEN_CLI_OPTS
- name: 'Artifact: prepare'
run: |
mkdir -p artifact/target/surefire-reports/it
cp -r target/surefire-reports/* artifact/target/surefire-reports/it/
cp -r target/jacoco.exec artifact/target/surefire-reports/it/
- name: 'Test result'
uses: actions/upload-artifact@v2
with:
name: target-artifact
path: artifact
quality-gate:
name: Quality Gate
runs-on: [ ubuntu-latest ]
needs: [ unit-test, it-test ]
continue-on-error: true
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Java: Setup'
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.2
- name: 'Artifact: download'
uses: actions/download-artifact@v2
with:
name: target-artifact
- name: 'Maven: verify'
run: mvn verify -DskipTests=true -Dcode.coverage=0.00 $MAVEN_CLI_OPTS
- name: 'Maven: sonar'
run: mvn sonar:sonar -Dsonar.login=$SONAR_TOKEN -Dsonar.branch.name=${GITHUB_REF##*/} $MAVEN_CLI_OPTS
build:
name: Build
runs-on: [ ubuntu-latest ]
needs: [ quality-gate, security-check ]
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Java: Setup'
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.2
- name: 'Maven: versions:set'
run: |
mvn release:update-versions -DdevelopmentVersion=0.0.1-SNAPSHOT $MAVEN_CLI_OPTS
mvn versions:set -DnewVersion=$VERSION $MAVEN_CLI_OPTS
- name: 'Maven: package'
run: mvn package -P prod -Dcode.coverage=0.00 -DskipTests=true $MAVEN_CLI_OPTS
- name: 'Artifact: prepare'
run: |
mkdir -p artifact/target
cp target/*.jar artifact/target/
- name: 'Artifact: upload'
uses: actions/upload-artifact@v2
with:
name: target-artifact
path: artifact
publish:
name: Publish
runs-on: [ ubuntu-latest ]
needs: [ build ]
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Java: Setup'
uses: actions/setup-java@v2
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
- name: Set up Maven
uses: stCarolas/setup-maven@v4
with:
maven-version: 3.8.2
- name: 'Maven: versions:set'
run: |
mvn release:update-versions -DdevelopmentVersion=0.0.1-SNAPSHOT $MAVEN_CLI_OPTS
mvn versions:set -DnewVersion=$VERSION $MAVEN_CLI_OPTS
- name: 'Maven: deploy'
run: mvn deploy -Dcode.coverage=0.0 -DskipTests=true $MAVEN_CLI_OPTS