forked from ham1/frameworkium-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
207 lines (202 loc) · 6.38 KB
/
ci.yaml
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
name: FWium-lite CI
on: [ push ]
jobs:
test-local:
runs-on: ubuntu-latest
env:
THREAD_COUNT: 2
steps:
- uses: actions/checkout@v2
- name: Setup JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'adopt'
- name: Cache Maven deps
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Compile, run checkstyle and unit tests
run: |
mvn test-compile surefire:test \
--batch-mode --show-version
- name: Install Firefox and Gecko Driver
run: |
sudo apt update && sudo apt install -y firefox
export GECKO_VER=0.33.0
wget --quiet https://github.com/mozilla/geckodriver/releases/download/v${GECKO_VER}/geckodriver-v${GECKO_VER}-linux64.tar.gz
tar -xzf geckodriver-v${GECKO_VER}-linux64.tar.gz
- name: Use custom Firefox browser impl
run: |
mvn verify --batch-mode \
-Dskip.surefire.tests=true \
-DcustomBrowserImpl=com.frameworkium.integration.CustomFirefoxImpl \
-Dheadless=true \
-Dmaximise=true \
-Dit.test=DocumentationTest
- name: Test Groups using Firefox
run: |
mvn verify --batch-mode \
-Dskip.surefire.tests=true \
-Dbrowser=firefox \
-Dheadless \
-DreuseBrowser \
-Dgroups=fw-bugs
- name: Install chrome and chromedriver locally
run: |
wget --quiet https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb
- name: Run tests against local Chrome
run: |
mvn verify --batch-mode \
-Dskip.surefire.tests=true \
-Dthreads=${THREAD_COUNT} \
-Dbrowser=chrome \
-Dheadless \
-DreuseBrowser
- uses: actions/upload-artifact@v2
if: failure()
with:
name: fwium-logs
path: logs/
retention-days: 7
- uses: codecov/codecov-action@v1
test-chrome-grid:
runs-on: ubuntu-latest
container:
image: maven:3.8-jdk-11
env:
HUB_HOST: hub
THREAD_COUNT: 2
services:
hub:
image: selenium/hub:4.7
ports:
- 4442-4444:4442-4444
chrome1:
image: selenium/node-chrome:4.7
options: -v /dev/shm:/dev/shm
env:
SE_EVENT_BUS_PUBLISH_PORT: 4442
SE_EVENT_BUS_SUBSCRIBE_PORT: 4443
SE_EVENT_BUS_HOST: hub
chrome2:
image: selenium/node-chrome:4.7
options: -v /dev/shm:/dev/shm
env:
SE_EVENT_BUS_PUBLISH_PORT: 4442
SE_EVENT_BUS_SUBSCRIBE_PORT: 4443
SE_EVENT_BUS_HOST: hub
steps:
- uses: actions/checkout@v2
- name: Cache Maven deps
uses: actions/cache@v2
with:
path: /root/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Run tests against Chrome grid
run: |
mvn verify --batch-mode \
-Dskip.surefire.tests=true \
-Dthreads=${THREAD_COUNT} \
-Dbrowser=chrome \
-Dheadless \
-DreuseBrowser \
-DgridURL=http://${HUB_HOST}:4444/
- uses: actions/upload-artifact@v2
if: failure()
with:
name: fwium-logs
path: logs/
retention-days: 7
- uses: codecov/codecov-action@v1
test-firefox-grid:
runs-on: ubuntu-latest
container:
image: maven:3.8-jdk-11
env:
HUB_HOST: hub
THREAD_COUNT: 2
services:
hub:
image: selenium/hub:4.7
ports:
- 4442-4444:4442-4444
firefox1:
image: selenium/node-firefox:4.7
options: -v /dev/shm:/dev/shm
env:
SE_EVENT_BUS_PUBLISH_PORT: 4442
SE_EVENT_BUS_SUBSCRIBE_PORT: 4443
SE_EVENT_BUS_HOST: hub
firefox2:
image: selenium/node-firefox:4.7
options: -v /dev/shm:/dev/shm
env:
SE_EVENT_BUS_PUBLISH_PORT: 4442
SE_EVENT_BUS_SUBSCRIBE_PORT: 4443
SE_EVENT_BUS_HOST: hub
steps:
- uses: actions/checkout@v2
- name: Cache Maven deps
uses: actions/cache@v2
with:
path: /root/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Run using yaml FirefoxGrid config
run: |
mvn verify --batch-mode \
-Dskip.surefire.tests=true \
-Dthreads=${THREAD_COUNT} \
-Dit.test=EnglishCountiesTest \
-Dconfig=FirefoxGrid.yaml
- name: Run tests against Firefox grid
run: |
mvn verify --batch-mode \
-Dskip.surefire.tests=true \
-Dit.test=TheInternetExampleTests \
-Dthreads=${THREAD_COUNT} \
-Dbrowser=firefox \
-Dheadless \
-DreuseBrowser \
-DgridURL=http://${HUB_HOST}:4444/
- uses: actions/upload-artifact@v2
if: failure()
with:
name: fwium-logs
path: logs/
retention-days: 7
- uses: codecov/codecov-action@v1
sonar:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Setup JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Cache Sonar packages
uses: actions/cache@v2
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyse
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B test-compile surefire:test org.sonarsource.scanner.maven:sonar-maven-plugin:sonar