-
Notifications
You must be signed in to change notification settings - Fork 47
286 lines (248 loc) · 12.5 KB
/
main.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
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: JDI auto-tests
env:
CHROME_PROPERTIES: "chrome.properties"
FIREFOX_PROPERTIES: "ff.properties"
WITH_PARAMS: "-ntp -Ddriver=chrome" # for Chrome: "-ntp -Ddriver=chrome", for FF: "-ntp -Ddriver=firefox"
UNIT: "-Punit"
COMMON: "-Pcommon"
COMPLEX: "-Pcomplex"
PERF: "-Pperformance"
FUNC: "-Pfunctional"
GROUP_ID: "com.epam.jdi"
NOPO_TESTS: "jdi-bdd-no-po-tests"
NOPO_TESTS_PROPERTY: "test-examples/jdi-bdd-no-po-tests"
BDD_TESTS: "jdi-bdd-tests"
BOOTSTRAP_TESTS: "jdi-light-bootstrap-tests"
HTML_TESTS: "jdi-light-html-tests"
VUETIFY_TESTS: "jdi-light-vuetify-tests"
# ANGULAR_TESTS: "jdi-light-angular-tests"
# ANGULAR_TESTS_WITH_MOCKS: "jdi-light-angular-tests-with-mocks"
EXAMPLES: "jdi-light-examples"
EXAMPLES_PROPERTY: "test-examples/jdi-light-examples"
PERFORMANCE: "jdi-performance"
MATERIAL_UI: "jdi-light-material-ui-tests"
PERFORMANCE_PROPERTY: "test-examples/jdi-performance"
CHROME_ARGS: "--no-sandbox --headless --disable-dev-shm-usage --disable-gpu --window-size=1920,1080 --remote-allow-origins=*"
FIREFOX_ARGS: "-headless"
ALLURE_VERSION: "2.13.8"
SUREFIRE_ARGS: "--add-opens java.base/java.lang=ALL-UNNAMED"
SUREFIRE_ARGS_BDD: "--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.desktop/java.awt.font=ALL-UNNAMED"
on:
push:
paths-ignore: [ '*.md' ]
branches:
- master
pull_request:
paths-ignore: [ '*.md' ]
branches:
- master
release:
types: # This configuration does not affect the page_build event above
- created
jobs:
build:
name: Tests on JDK
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
java: [11, 15, 17, 18] # all [11, 12, 13, 14, 15, 16, 17, 18, 21]
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
java-package: jdk
distribution: 'zulu'
cache: 'maven'
- name: Prepare environment
run: |
sudo apt install zip
java -Xmx32m -version
ls -lah
env
id
# run cann't start from comment
# curl -o allure-${ALLURE_VERSION}.tgz -Ls https://dl.bintray.com/qameta/generic/io/qameta/allure/allure/${ALLURE_VERSION}/allure-${ALLURE_VERSION}.tgz
- name: Install Allure
run: |
sudo tar -zxvf allure.tgz -C /opt/
sudo ln -s /opt/allure-${ALLURE_VERSION}/bin/allure /usr/bin/allure
allure --version
# - name: Install Netlify
# run: sudo npm install -g netlify-cli
- name: Welcome to JDI
run: |
echo ------------------- WELCOME TO JDI -----------------------
mvn --version
- name: Prepare configs
run: |
echo arguments=$CHROME_ARGS > "./${BDD_TESTS}/src/test/resources/${CHROME_PROPERTIES}"
echo arguments=$FIREFOX_ARGS > "./${BDD_TESTS}/src/test/resources/${FIREFOX_PROPERTIES}"
echo arguments=$CHROME_ARGS > "./${BOOTSTRAP_TESTS}/src/test/resources/${CHROME_PROPERTIES}"
echo arguments=$FIREFOX_ARGS > "./${BOOTSTRAP_TESTS}/src/test/resources/${FIREFOX_PROPERTIES}"
echo arguments=$CHROME_ARGS > "./${HTML_TESTS}/src/test/resources/${CHROME_PROPERTIES}"
echo arguments=$FIREFOX_ARGS > "./${HTML_TESTS}/src/test/resources/${FIREFOX_PROPERTIES}"
echo arguments=$CHROME_ARGS > "./${EXAMPLES_PROPERTY}/src/test/resources/${CHROME_PROPERTIES}"
echo arguments=$FIREFOX_ARGS > "./${EXAMPLES_PROPERTY}/src/test/resources/${FIREFOX_PROPERTIES}"
echo arguments=$CHROME_ARGS > "./${PERFORMANCE_PROPERTY}/src/test/resources/${CHROME_PROPERTIES}"
echo arguments=$FIREFOX_ARGS > "./${PERFORMANCE_PROPERTY}/src/test/resources/${FIREFOX_PROPERTIES}"
echo arguments=$CHROME_ARGS > "./${MATERIAL_UI}/src/test/resources/${CHROME_PROPERTIES}"
echo arguments=$FIREFOX_ARGS > "./${MATERIAL_UI}/src/test/resources/${FIREFOX_PROPERTIES}"
echo arguments=$CHROME_ARGS > "./${VUETIFY_TESTS}/src/test/resources/${CHROME_PROPERTIES}"
echo arguments=$FIREFOX_ARGS > "./${VUETIFY_TESTS}/src/test/resources/${FIREFOX_PROPERTIES}"
- name: Compile jdi code
id: jdi-compile
run: mvn -ntp install -DskipTests -Dsource.skip -Dmaven.source.skip -Dmaven.javadoc.skip=true
# ========== steps before required for all tasks ==================
- name: Tests BDD
id: tests-bdd
if: steps.jdi-compile.outcome == 'success'
timeout-minutes: 30 # prevent blocking
continue-on-error: true
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} -pl $GROUP_ID:$BDD_TESTS --fail-at-end
- name: Tests BDD Firefox
id: tests-bdd-firefox
if: steps.jdi-compile.outcome == 'success'
timeout-minutes: 30 # prevent blocking
continue-on-error: true
run: mvn verify -ntp -Ddriver=firefox -Dcucumber.filter.tags="not @ignore_for_firefox" -Dff.capabilities.path=${FIREFOX_PROPERTIES} -pl $GROUP_ID:$BDD_TESTS --fail-at-end
##### Example for original allure data upload
# - name: 'Upload BDD results'
# uses: actions/upload-artifact@v2
# with:
# name: bdd-results-sdk${{ matrix.java }}
# path: ./${BDD_TESTS}/target/allure-results/
# retention-days: 1
- name: Tests bootstrap Unit
id: tests-bootstrap
if: steps.jdi-compile.outcome == 'success'
timeout-minutes: 20 # prevent blocking
continue-on-error: true
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} -pl $GROUP_ID:$BOOTSTRAP_TESTS --fail-at-end
# - name: Run tests - Angular Unit tests
# id: tests-angular-unit
# if: steps.jdi-compile.outcome == 'success'
# timeout-minutes: 40 # prevent blocking
# continue-on-error: true
# run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} $UNIT -pl $GROUP_ID:$ANGULAR_TESTS --fail-at-end
# - name: Run tests - Angular Common tests
# id: tests-angular-common
# if: steps.jdi-compile.outcome == 'success'
# timeout-minutes: 30 # prevent blocking
# continue-on-error: true
# run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} $COMMON -pl $GROUP_ID:$ANGULAR_TESTS --fail-at-end
# - name: Run tests - Angular Complex tests
# id: tests-angular-complex
# if: steps.jdi-compile.outcome == 'success'
# timeout-minutes: 60 # prevent blocking
# continue-on-error: true
# run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} $COMPLEX -pl $GROUP_ID:$ANGULAR_TESTS --fail-at-end
- name: Run tests - HTML functional
id: tests-html-func
if: steps.jdi-compile.outcome == 'success'
timeout-minutes: 90 # prevent blocking
continue-on-error: true
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} $FUNC -pl $GROUP_ID:$HTML_TESTS --fail-at-end
- name: Run tests - HTML performance
id: tests-html-perf
if: steps.jdi-compile.outcome == 'success'
timeout-minutes: 90 # prevent blocking
continue-on-error: true
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} $PERF -pl $GROUP_ID:$HTML_TESTS --fail-at-end
- name: Run tests - Test Examples
id: tests-examples
if: steps.jdi-compile.outcome == 'success'
timeout-minutes: 20 # prevent blocking
continue-on-error: true
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} -pl $GROUP_ID:$EXAMPLES --fail-at-end
- name: Run tests - Material UI
id: tests-material-ui
if: steps.jdi-compile.outcome == 'success'
timeout-minutes: 40 # prevent blocking
continue-on-error: true
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} $FUNC -pl $GROUP_ID:$MATERIAL_UI --fail-at-end
- name: Run tests - Vuetify
id: tests-vuetify
if: ${{ steps.jdi-compile.outcome == 'success' }}
continue-on-error: true
timeout-minutes: 30 # prevent blocking
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} -pl $GROUP_ID:$VUETIFY_TESTS --fail-at-end
- name: Run tests - Performance
id: tests-perf
if: steps.jdi-compile.outcome == 'success'
timeout-minutes: 20 # prevent blocking
continue-on-error: true
run: mvn verify $WITH_PARAMS -Dchrome.capabilities.path=${CHROME_PROPERTIES} -Dff.capabilities.path=${FIREFOX_PROPERTIES} -pl $GROUP_ID:$PERFORMANCE --fail-at-end
- name: Collect reports
if: steps.jdi-compile.outcome == 'success'
run: |
echo --------------- Collecting Allure Reports.... ------------------
sudo chmod +x reporting.sh
source reporting.sh
generateAllureReports
printAllureSummary ${{ matrix.java }}
zip -r allure-report.zip ./allure-report/
- name: 'Upload allure report'
if: steps.jdi-compile.outcome == 'success'
uses: actions/upload-artifact@v4
with:
name: allure-report-jdk${{ matrix.java }}
path: ./allure-report.zip
retention-days: 1
- name: 'All statuses of the tests'
if: steps.jdi-compile.outcome == 'success'
run: |
echo BDD tests result: ${{ steps.tests-bdd.outcome }}
echo BDD Firefox tests result: ${{ steps.tests-bdd-firefox.outcome }}
echo HTML tests result: ${{ steps.tests-html-func.outcome }}
echo Example tests result: ${{ steps.tests-examples.outcome }}
echo Material ui tests result: ${{ steps.tests-material-ui.outcome }}
echo HTML Performance tests result: ${{ steps.tests-html-perf.outcome }}
echo Performance tests result: ${{ steps.tests-perf.outcome }}
echo Vuetify tests result: ${{ steps.tests-vuetify.outcome }}
- name: Check BDD are passed
if: ${{ steps.tests-bdd.outcome != 'success' || steps.tests-bdd-firefox.outcome != 'success' }}
run: |
echo BDD tests result: ${{ steps.tests-bdd.outcome }}
echo BDD Firefox tests result: ${{ steps.tests-bdd-firefox.outcome }}
exit 1
- name: Check Bootstrap are passed
if: ${{ steps.tests-bootstrap.outcome != 'success' }}
run: |
echo bootstrap tests result: ${{ steps.tests-bootstrap.outcome }}
exit 1
- name: Check html tests are passed
if: ${{ steps.tests-html-func.outcome != 'success' || steps.tests-examples.outcome != 'success' }}
run: |
echo HTML tests result: ${{ steps.tests-html-func.outcome }}
echo Example tests result: ${{ steps.tests-examples.outcome }}
exit 1
- name: Check Material-ui tests are passed
if: ${{ steps.tests-material-ui.outcome != 'success' }}
run: |
echo Material ui tests result: ${{ steps.tests-material-ui.outcome }}
exit 1
# - name: Check angular tests are passed
# if: ${{ steps.tests-angular-common.outcome != 'success' }}
# for full angular should be
# if: ${{ steps.tests-angular-unit.outcome != 'success' || steps.tests-angular-common.outcome != 'success' || steps.tests-angular-complex.outcome != 'success' }}
# echo Angular Complex tests result: ${{ steps.tests-angular-complex.outcome }}
# echo Angular Unit tests result: ${{ steps.tests-angular-unit.outcome }}
# run: |
# echo Angular Common tests result: ${{ steps.tests-angular-common.outcome }}
# exit 1
- name: Check performance tests are passed
if: ${{ steps.tests-html-perf.outcome != 'success' || steps.tests-perf.outcome != 'success' }}
run: |
echo HTML Performance tests result: ${{ steps.tests-html-perf.outcome }}
echo Performance tests result: ${{ steps.tests-perf.outcome }}
exit 1
- name: Check Vuetify tests are passed
if: ${{ steps.tests-vuetify.outcome != 'success' }}
run: |
echo Vuetify tests result: ${{ steps.tests-vuetify.outcome }}
exit 1