-
-
Notifications
You must be signed in to change notification settings - Fork 240
281 lines (275 loc) · 11.5 KB
/
docker-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
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
name: Docker
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `v1.2.3` tags as releases.
tags:
- '*'
# Run tests for any PRs.
pull_request:
env:
# The image name
IMAGE_NAME: docker-robot-framework:ci
jobs:
# Build and run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
build:
runs-on: ubuntu-latest
# run all our tests on each browser
strategy:
matrix:
include:
- browser: "chrome"
- browser: "firefox"
env:
BROWSER: ${{ matrix.browser }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build image
run:
podman build . --tag $IMAGE_NAME --file Dockerfile
- name: Basic Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/browser-library.robot:/opt/robotframework/tests/browser-library.robot:Z \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
-e BROWSER=$BROWSER \
$IMAGE_NAME
- name: Test dependency installation
run: |
podman run --shm-size=1g \
-v `pwd`/test/pip-dependencies/main.robot:/opt/robotframework/tests/pip-dependencies.robot:Z \
-v `pwd`/test/pip-dependencies/requirements.txt:/opt/robotframework/pip-requirements.txt:Z \
-e BROWSER=$BROWSER \
$IMAGE_NAME
- name: Colour Depth 16 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/browser-library.robot:/opt/robotframework/tests/browser-library.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_COLOUR_DEPTH=16 \
$IMAGE_NAME
- name: Screen Width 800x600 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/browser-library.robot:/opt/robotframework/tests/browser-library.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=800 \
-e SCREEN_HEIGHT=600 \
$IMAGE_NAME
- name: Screen Width 1024x768 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/browser-library.robot:/opt/robotframework/tests/browser-library.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=1024 \
-e SCREEN_HEIGHT=768 \
$IMAGE_NAME
- name: Screen Width 1280x1024 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/browser-library.robot:/opt/robotframework/tests/browser-library.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=1280 \
-e SCREEN_HEIGHT=1024 \
$IMAGE_NAME
- name: Screen Width 2560x1440 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/browser-library.robot:/opt/robotframework/tests/browser-library.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=2560 \
-e SCREEN_HEIGHT=1440 \
$IMAGE_NAME
- name: Screen Width 3840x2160 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/browser-library.robot:/opt/robotframework/tests/browser-library.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=3840 \
-e SCREEN_HEIGHT=2160 \
$IMAGE_NAME
- name: Debug Log Level Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-e BROWSER=$BROWSER \
-e ROBOT_OPTIONS="--loglevel DEBUG" \
$IMAGE_NAME
- name: Basic Multithreaded Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/browser-library.robot:/opt/robotframework/tests/browser-library.robot:Z \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
-e BROWSER=$BROWSER \
-e ROBOT_THREADS=4 \
$IMAGE_NAME
- name: Test Level Multithreaded Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/browser-library.robot:/opt/robotframework/tests/browser-library.robot:Z \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
-e BROWSER=$BROWSER \
-e ROBOT_THREADS=4 \
-e PABOT_OPTIONS="--testlevelsplit" \
$IMAGE_NAME
- name: Custom User Test
run: |
podman run --user=2000 --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-e BROWSER=$BROWSER \
$IMAGE_NAME
- name: Custom User and Group Test
run: |
podman run --user=2000:2000 --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-e BROWSER=$BROWSER \
$IMAGE_NAME
- name: Datetime
run: |
podman run --user=2000:2000 --shm-size=1g \
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
-e BROWSER=$BROWSER \
-e TZ="America/New_York" \
$IMAGE_NAME
# Build and run tests for Microsoft Edge.
# This must be processed separately from Firefox and Chrome, due to the Browser library not handling Microsoft Edge by default
# and having no easy way to install new browsers unfortunately.
build-microsoft-edge:
runs-on: ubuntu-latest
env:
BROWSER: "edge"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build image
run:
podman build . --tag $IMAGE_NAME --file Dockerfile
- name: Basic Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
-e BROWSER=$BROWSER \
$IMAGE_NAME
- name: Test dependency installation
run: |
podman run --shm-size=1g \
-v `pwd`/test/pip-dependencies/main.robot:/opt/robotframework/tests/pip-dependencies.robot:Z \
-v `pwd`/test/pip-dependencies/requirements.txt:/opt/robotframework/pip-requirements.txt:Z \
-e BROWSER=$BROWSER \
$IMAGE_NAME
- name: Colour Depth 16 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_COLOUR_DEPTH=16 \
$IMAGE_NAME
- name: Screen Width 800x600 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=800 \
-e SCREEN_HEIGHT=600 \
$IMAGE_NAME
- name: Screen Width 1024x768 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=1024 \
-e SCREEN_HEIGHT=768 \
$IMAGE_NAME
- name: Screen Width 1280x1024 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=1280 \
-e SCREEN_HEIGHT=1024 \
$IMAGE_NAME
- name: Screen Width 2560x1440 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=2560 \
-e SCREEN_HEIGHT=1440 \
$IMAGE_NAME
- name: Screen Width 3840x2160 Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-e BROWSER=$BROWSER \
-e SCREEN_WIDTH=3840 \
-e SCREEN_HEIGHT=2160 \
$IMAGE_NAME
- name: Debug Log Level Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-e BROWSER=$BROWSER \
-e ROBOT_OPTIONS="--loglevel DEBUG" \
$IMAGE_NAME
- name: Basic Multithreaded Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
-e BROWSER=$BROWSER \
-e ROBOT_THREADS=4 \
$IMAGE_NAME
- name: Test Level Multithreaded Test
run: |
podman run --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-v `pwd`/test/requests.robot:/opt/robotframework/tests/requests.robot:Z \
-v `pwd`/test/selenium.robot:/opt/robotframework/tests/selenium.robot:Z \
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
-e BROWSER=$BROWSER \
-e ROBOT_THREADS=4 \
-e PABOT_OPTIONS="--testlevelsplit" \
$IMAGE_NAME
- name: Custom User Test
run: |
podman run --user=2000 --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-e BROWSER=$BROWSER \
$IMAGE_NAME
- name: Custom User and Group Test
run: |
podman run --user=2000:2000 --shm-size=1g \
-v `pwd`/test/faker.robot:/opt/robotframework/tests/faker.robot:Z \
-e BROWSER=$BROWSER \
$IMAGE_NAME
- name: Datetime
run: |
podman run --user=2000:2000 --shm-size=1g \
-v `pwd`/test/timezones.robot:/opt/robotframework/tests/timezones.robot:Z \
-e BROWSER=$BROWSER \
-e TZ="America/New_York" \
$IMAGE_NAME