Skip to content

Commit afdfd32

Browse files
committed
Output mullvad version string directly from job
1 parent bea09e5 commit afdfd32

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

.github/workflows/desktop-e2e.yml

+34-34
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,24 @@
99
name: Desktop - End-to-end tests
1010
on:
1111
schedule:
12-
- cron: '0 0 * * *'
12+
- cron: "0 0 * * *"
1313
workflow_dispatch:
1414
inputs:
1515
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`. \
1718
Available images:\n
1819
`debian11 debian12 ubuntu2004 ubuntu2204 ubuntu2404 ubuntu2410 fedora39 \
1920
fedora40 fedora41 windows10 windows11 macos12 macos13 macos14 macos15`.\n
2021
Default images:\n
2122
`debian12 ubuntu2004 ubuntu2204 ubuntu2404 ubuntu2410 fedora39 \
2223
fedora40 fedora41 windows10 windows11 macos13 macos14 macos15`."
23-
default: ''
24+
default: ""
2425
required: false
2526
type: string
2627
tests:
2728
description: "Tests to run (defaults to all if empty)"
28-
default: ''
29+
default: ""
2930
required: false
3031
type: string
3132

@@ -95,7 +96,8 @@ jobs:
9596
uses: actions/checkout@v4
9697
- name: Use custom container image if specified
9798
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 }}"
99101
>> $GITHUB_ENV
100102
- name: Use default container image and resolve digest
101103
if: ${{ github.event.inputs.override_container_image == '' }}
@@ -145,7 +147,7 @@ jobs:
145147
run: ./desktop/packages/mullvad-vpn/scripts/build-test-executable.sh
146148
- name: Upload app
147149
uses: actions/upload-artifact@v4
148-
if: '!cancelled()'
150+
if: "!cancelled()"
149151
with:
150152
name: linux-build
151153
path: |
@@ -157,6 +159,8 @@ jobs:
157159
name: Build mullvad-version
158160
needs: prepare-linux
159161
runs-on: ubuntu-latest
162+
outputs:
163+
mullvad-version: ${{ steps.cargo-run.outputs.mullvad-version }}
160164
container:
161165
image: ${{ needs.prepare-linux.outputs.container_image }}
162166
if: |
@@ -171,18 +175,12 @@ jobs:
171175
- name: Checkout repository
172176
uses: actions/checkout@v4
173177
- name: Build mullvad-version
178+
id: cargo-run
174179
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"
179183
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
186184

187185
# This step should always be run because the `test-manager` binary is used to compile the
188186
# result matrix at the end! If that functionality is ever split out from the `test-manager`,
@@ -199,7 +197,7 @@ jobs:
199197
- name: Build test-manager
200198
run: ./test/scripts/container-run.sh cargo build --package test-manager --release
201199
- uses: actions/upload-artifact@v4
202-
if: '!cancelled()'
200+
if: "!cancelled()"
203201
with:
204202
name: linux-test-manager-build
205203
path: |
@@ -231,7 +229,7 @@ jobs:
231229
"$CARGO_TARGET_DIR/x86_64-unknown-linux-gnu/release/test-runner" \
232230
"$CARGO_TARGET_DIR/x86_64-unknown-linux-gnu/release/connection-checker"
233231
- uses: actions/upload-artifact@v4
234-
if: '!cancelled()'
232+
if: "!cancelled()"
235233
with:
236234
name: linux-test-runner-binaries
237235
path: bin/*
@@ -240,7 +238,14 @@ jobs:
240238
e2e-test-linux:
241239
name: Linux end-to-end tests
242240
# 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+
]
244249
if: |
245250
!cancelled() &&
246251
needs.prepare-matrices.outputs.linux_matrix != '[]' &&
@@ -266,11 +271,6 @@ jobs:
266271
with:
267272
name: linux-test-manager-build
268273
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
274274
- name: Download Test Runner binaries
275275
uses: actions/download-artifact@v4
276276
if: ${{ needs.build-test-runner-binaries-linux.result == 'success' }}
@@ -290,17 +290,17 @@ jobs:
290290
- name: Run end-to-end tests
291291
shell: bash -ieo pipefail {0}
292292
run: |
293+
echo "${{needs.build-mullvad-version-linux.outputs.mullvad-version}}"
293294
# A directory with all the binaries is required to run test-manager.
294295
# The test scripts which runs in CI expects this folder to be available as the `TEST_DIST_DIR` variable.
295296
export TEST_DIST_DIR="${{ github.workspace }}/bin/"
296297
git fetch --tags --prune-tags --force
297298
export TEST_FILTERS="${{ github.event.inputs.tests }}"
298299
ls -la "$TEST_DIST_DIR"
299-
${{ github.workspace }}/bin/mullvad-version
300300
./test/scripts/run/ci.sh ${{ matrix.os }}
301301
- name: Upload test report
302302
uses: actions/upload-artifact@v4
303-
if: '!cancelled()'
303+
if: "!cancelled()"
304304
with:
305305
name: ${{ matrix.os }}_report
306306
path: ./test/.ci-logs/${{ matrix.os }}_report
@@ -326,7 +326,7 @@ jobs:
326326
- uses: actions/setup-node@v4
327327
with:
328328
node-version-file: desktop/package.json
329-
cache: 'npm'
329+
cache: "npm"
330330
cache-dependency-path: desktop/package-lock.json
331331
- name: Install Rust
332332
run: rustup target add i686-pc-windows-msvc
@@ -354,7 +354,7 @@ jobs:
354354
shell: bash
355355
run: ./desktop/packages/mullvad-vpn/scripts/build-test-executable.sh
356356
- uses: actions/upload-artifact@v4
357-
if: '!cancelled()'
357+
if: "!cancelled()"
358358
with:
359359
name: windows-build
360360
path: .\dist\*.exe
@@ -389,7 +389,7 @@ jobs:
389389
./test/scripts/run/ci.sh ${{ matrix.os }}
390390
- name: Upload test report
391391
uses: actions/upload-artifact@v4
392-
if: '!cancelled()'
392+
if: "!cancelled()"
393393
with:
394394
name: ${{ matrix.os }}_report
395395
path: ./test/.ci-logs/${{ matrix.os }}_report
@@ -419,14 +419,14 @@ jobs:
419419
- uses: actions/setup-node@v4
420420
with:
421421
node-version-file: desktop/package.json
422-
cache: 'npm'
422+
cache: "npm"
423423
cache-dependency-path: desktop/package-lock.json
424424
- name: Build app
425425
run: ./build.sh
426426
- name: Build test executable
427427
run: ./desktop/packages/mullvad-vpn/scripts/build-test-executable.sh
428428
- uses: actions/upload-artifact@v4
429-
if: '!cancelled()'
429+
if: "!cancelled()"
430430
with:
431431
name: macos-build
432432
path: |
@@ -463,23 +463,23 @@ jobs:
463463
./test/scripts/run/ci.sh ${{ matrix.os }}
464464
- name: Upload test report
465465
uses: actions/upload-artifact@v4
466-
if: '!cancelled()'
466+
if: "!cancelled()"
467467
with:
468468
name: ${{ matrix.os }}_report
469469
path: ./test/.ci-logs/${{ matrix.os }}_report
470470

471471
compile-test-matrix:
472472
name: Result matrix
473473
needs: [e2e-test-linux, e2e-test-windows, e2e-test-macos]
474-
if: '!cancelled()'
474+
if: "!cancelled()"
475475
runs-on: ubuntu-latest
476476
container:
477477
image: ${{ needs.prepare-linux.outputs.container_image }}
478478
steps:
479479
- name: Download test report
480480
uses: actions/download-artifact@v4
481481
with:
482-
pattern: '*_report'
482+
pattern: "*_report"
483483
merge-multiple: true
484484
- name: Create binaries directory
485485
shell: bash -ieo pipefail {0}

0 commit comments

Comments
 (0)