-
Notifications
You must be signed in to change notification settings - Fork 16
115 lines (101 loc) · 3.86 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
name: Testing JDI Dark
env:
HTTP_TESTS: "com.epam.jdi:jdi-dark-tests"
BDD_TESTS: "com.epam.jdi:jdi-dark-bdd-tests"
ALLURE_VERSION: "2.7.0"
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:
branches:
- master
pull_request:
branches:
- master
page_build:
release:
types: # This configuration does not affect the page_build event above
- created
jobs:
build:
name: Run tests for JDK
runs-on: ubuntu-20.04
strategy:
max-parallel: 2 # can be removed to speed-up, but it's not always stable
fail-fast: false
matrix:
java: [8, 11, 15, 17, 18] # [8, 11, 13, 14, 15, 17, 18, 21]
steps:
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
java-package: jdk
distribution: 'zulu'
cache: 'maven'
- name: Prepare environment
run: |
sudo apt-get -y install jq
java -Xmx32m -version
env
# 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-${ALLURE_VERSION}.tgz -C /opt/
sudo ln -s /opt/allure-${ALLURE_VERSION}/bin/allure /usr/bin/allure
allure --version
- name: Welcome to JDI
run: |
echo ------------------- WELCOME TO JDI DARK ----------------------
mvn --version
- name: Compile jdi code
id: jdi-compile
run: mvn clean install -DskipTests -Dsource.skip -Dmaven.source.skip -Dmaven.javadoc.skip=true -ntp
- name: Run tests - BDD
id: testsBdd
if: steps.jdi-compile.outcome == 'success'
timeout-minutes: 30 # prevent blocking
continue-on-error: true
run: mvn verify -pl $BDD_TESTS --fail-at-end
- name: Run tests - HTTP
id: testsHttp
if: steps.jdi-compile.outcome == 'success'
timeout-minutes: 30 # prevent blocking
continue-on-error: true
run: mvn verify -pl $HTTP_TESTS --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@v3
with:
name: allure-report-dark-jdk${{ matrix.java }}
path: ./allure-report.zip
retention-days: 2
# - name: Deploy to Neflify
# uses: South-Paw/[email protected]
# with:
# github-token: ${{ secrets.GIT_COMMENT_USER }}
# netlify-auth-token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
# netlify-site-id: ${{ secrets.NETLIFY_SITE_ID }}
# build-dir: './allure-report'
# comment-on-pull-request: true
- name: Test Coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Check for any failure
if: ${{ (steps.testsBdd.outcome != 'success') || (steps.testsHttp.outcome != 'success')}}
run: |
echo BDD tests result ${{ steps.testsBdd.outcome }}
echo HTTP tests result ${{ steps.testsHttp.outcome }}
exit 1