9
9
name : Desktop - End-to-end tests
10
10
on :
11
11
schedule :
12
- - cron : ' 0 0 * * *'
12
+ - cron : " 0 0 * * *"
13
13
workflow_dispatch :
14
14
inputs :
15
15
oses :
16
- description : " Space-delimited list of targets to run tests on, e.g. `debian12 ubuntu2004`. \
16
+ description :
17
+ " Space-delimited list of targets to run tests on, e.g. `debian12 ubuntu2004`. \
17
18
Available images:\n
18
19
`debian11 debian12 ubuntu2004 ubuntu2204 ubuntu2404 ubuntu2410 fedora39 \
19
20
fedora40 fedora41 windows10 windows11 macos12 macos13 macos14 macos15`.\n
20
21
Default images:\n
21
22
`debian12 ubuntu2004 ubuntu2204 ubuntu2404 ubuntu2410 fedora39 \
22
23
fedora40 fedora41 windows10 windows11 macos13 macos14 macos15`."
23
- default : ' '
24
+ default : " "
24
25
required : false
25
26
type : string
26
27
tests :
27
28
description : " Tests to run (defaults to all if empty)"
28
- default : ' '
29
+ default : " "
29
30
required : false
30
31
type : string
31
32
95
96
uses : actions/checkout@v4
96
97
- name : Use custom container image if specified
97
98
if : ${{ github.event.inputs.override_container_image != '' }}
98
- run : echo "inner_container_image=${{ github.event.inputs.override_container_image }}"
99
+ run :
100
+ echo "inner_container_image=${{ github.event.inputs.override_container_image }}"
99
101
>> $GITHUB_ENV
100
102
- name : Use default container image and resolve digest
101
103
if : ${{ github.event.inputs.override_container_image == '' }}
@@ -145,7 +147,7 @@ jobs:
145
147
run : ./desktop/packages/mullvad-vpn/scripts/build-test-executable.sh
146
148
- name : Upload app
147
149
uses : actions/upload-artifact@v4
148
- if : ' !cancelled()'
150
+ if : " !cancelled()"
149
151
with :
150
152
name : linux-build
151
153
path : |
@@ -157,6 +159,8 @@ jobs:
157
159
name : Build mullvad-version
158
160
needs : prepare-linux
159
161
runs-on : ubuntu-latest
162
+ outputs :
163
+ mullvad-version : ${{ steps.cargo-run.outputs.mullvad-version }}
160
164
container :
161
165
image : ${{ needs.prepare-linux.outputs.container_image }}
162
166
if : |
@@ -171,18 +175,12 @@ jobs:
171
175
- name : Checkout repository
172
176
uses : actions/checkout@v4
173
177
- name : Build mullvad-version
178
+ id : cargo-run
174
179
run : |
175
- cargo build --package mullvad-version --release
176
- # Move `mullvad-version` to a known location. This is needed in the coming `upload-artifact` step.
177
- mkdir bin
178
- mv -t ./bin/ "$CARGO_TARGET_DIR/release/mullvad-version"
180
+ version=$(cargo run --package mullvad-version -q)
181
+ echo "mullvad-version=$(version)"
182
+ echo "mullvad-version=${version}" >> "$GITHUB_OUTPUT"
179
183
shell : bash
180
- - name : Upload mullvad-version
181
- uses : actions/upload-artifact@v4
182
- with :
183
- name : mullvad-version-linux
184
- path : ./bin/mullvad-version
185
- if-no-files-found : error
186
184
187
185
# This step should always be run because the `test-manager` binary is used to compile the
188
186
# result matrix at the end! If that functionality is ever split out from the `test-manager`,
@@ -199,7 +197,7 @@ jobs:
199
197
- name : Build test-manager
200
198
run : ./test/scripts/container-run.sh cargo build --package test-manager --release
201
199
- uses : actions/upload-artifact@v4
202
- if : ' !cancelled()'
200
+ if : " !cancelled()"
203
201
with :
204
202
name : linux-test-manager-build
205
203
path : |
@@ -231,7 +229,7 @@ jobs:
231
229
"$CARGO_TARGET_DIR/x86_64-unknown-linux-gnu/release/test-runner" \
232
230
"$CARGO_TARGET_DIR/x86_64-unknown-linux-gnu/release/connection-checker"
233
231
- uses : actions/upload-artifact@v4
234
- if : ' !cancelled()'
232
+ if : " !cancelled()"
235
233
with :
236
234
name : linux-test-runner-binaries
237
235
path : bin/*
@@ -240,7 +238,14 @@ jobs:
240
238
e2e-test-linux :
241
239
name : Linux end-to-end tests
242
240
# yamllint disable-line rule:line-length
243
- needs : [prepare-matrices, build-linux-app, build-mullvad-version-linux, build-test-manager-linux, build-test-runner-binaries-linux]
241
+ needs :
242
+ [
243
+ prepare-matrices,
244
+ build-linux-app,
245
+ build-mullvad-version-linux,
246
+ build-test-manager-linux,
247
+ build-test-runner-binaries-linux,
248
+ ]
244
249
if : |
245
250
!cancelled() &&
246
251
needs.prepare-matrices.outputs.linux_matrix != '[]' &&
@@ -266,11 +271,6 @@ jobs:
266
271
with :
267
272
name : linux-test-manager-build
268
273
path : ${{ github.workspace }}/bin
269
- - name : Download mullvad-version
270
- uses : actions/download-artifact@v4
271
- with :
272
- name : mullvad-version-linux
273
- path : ${{ github.workspace }}/bin
274
274
- name : Download Test Runner binaries
275
275
uses : actions/download-artifact@v4
276
276
if : ${{ needs.build-test-runner-binaries-linux.result == 'success' }}
@@ -290,17 +290,17 @@ jobs:
290
290
- name : Run end-to-end tests
291
291
shell : bash -ieo pipefail {0}
292
292
run : |
293
+ echo "${{needs.build-mullvad-version-linux.outputs.mullvad-version}}"
293
294
# A directory with all the binaries is required to run test-manager.
294
295
# The test scripts which runs in CI expects this folder to be available as the `TEST_DIST_DIR` variable.
295
296
export TEST_DIST_DIR="${{ github.workspace }}/bin/"
296
297
git fetch --tags --prune-tags --force
297
298
export TEST_FILTERS="${{ github.event.inputs.tests }}"
298
299
ls -la "$TEST_DIST_DIR"
299
- ${{ github.workspace }}/bin/mullvad-version
300
300
./test/scripts/run/ci.sh ${{ matrix.os }}
301
301
- name : Upload test report
302
302
uses : actions/upload-artifact@v4
303
- if : ' !cancelled()'
303
+ if : " !cancelled()"
304
304
with :
305
305
name : ${{ matrix.os }}_report
306
306
path : ./test/.ci-logs/${{ matrix.os }}_report
@@ -326,7 +326,7 @@ jobs:
326
326
- uses : actions/setup-node@v4
327
327
with :
328
328
node-version-file : desktop/package.json
329
- cache : ' npm'
329
+ cache : " npm"
330
330
cache-dependency-path : desktop/package-lock.json
331
331
- name : Install Rust
332
332
run : rustup target add i686-pc-windows-msvc
@@ -354,7 +354,7 @@ jobs:
354
354
shell : bash
355
355
run : ./desktop/packages/mullvad-vpn/scripts/build-test-executable.sh
356
356
- uses : actions/upload-artifact@v4
357
- if : ' !cancelled()'
357
+ if : " !cancelled()"
358
358
with :
359
359
name : windows-build
360
360
path : .\dist\*.exe
@@ -389,7 +389,7 @@ jobs:
389
389
./test/scripts/run/ci.sh ${{ matrix.os }}
390
390
- name : Upload test report
391
391
uses : actions/upload-artifact@v4
392
- if : ' !cancelled()'
392
+ if : " !cancelled()"
393
393
with :
394
394
name : ${{ matrix.os }}_report
395
395
path : ./test/.ci-logs/${{ matrix.os }}_report
@@ -419,14 +419,14 @@ jobs:
419
419
- uses : actions/setup-node@v4
420
420
with :
421
421
node-version-file : desktop/package.json
422
- cache : ' npm'
422
+ cache : " npm"
423
423
cache-dependency-path : desktop/package-lock.json
424
424
- name : Build app
425
425
run : ./build.sh
426
426
- name : Build test executable
427
427
run : ./desktop/packages/mullvad-vpn/scripts/build-test-executable.sh
428
428
- uses : actions/upload-artifact@v4
429
- if : ' !cancelled()'
429
+ if : " !cancelled()"
430
430
with :
431
431
name : macos-build
432
432
path : |
@@ -463,23 +463,23 @@ jobs:
463
463
./test/scripts/run/ci.sh ${{ matrix.os }}
464
464
- name : Upload test report
465
465
uses : actions/upload-artifact@v4
466
- if : ' !cancelled()'
466
+ if : " !cancelled()"
467
467
with :
468
468
name : ${{ matrix.os }}_report
469
469
path : ./test/.ci-logs/${{ matrix.os }}_report
470
470
471
471
compile-test-matrix :
472
472
name : Result matrix
473
473
needs : [e2e-test-linux, e2e-test-windows, e2e-test-macos]
474
- if : ' !cancelled()'
474
+ if : " !cancelled()"
475
475
runs-on : ubuntu-latest
476
476
container :
477
477
image : ${{ needs.prepare-linux.outputs.container_image }}
478
478
steps :
479
479
- name : Download test report
480
480
uses : actions/download-artifact@v4
481
481
with :
482
- pattern : ' *_report'
482
+ pattern : " *_report"
483
483
merge-multiple : true
484
484
- name : Create binaries directory
485
485
shell : bash -ieo pipefail {0}
0 commit comments