summaryrefslogtreecommitdiffhomepage
path: root/.github/workflows
diff options
context:
space:
mode:
authorSebastian Holmin <sebastian.holmin@mullvad.net>2025-03-18 11:07:05 +0100
committerSebastian Holmin <sebastian.holmin@mullvad.net>2025-03-18 11:07:47 +0100
commit53cbd13dac94cb74fdb0688c0abc92b32bb50bba (patch)
tree61b7f2dfe6a419f326de0f43361336af1a0d2fc7 /.github/workflows
parente9af9e754c57fb9646cc5701c0f34b285ece100f (diff)
downloadmullvadvpn-53cbd13dac94cb74fdb0688c0abc92b32bb50bba.tar.xz
mullvadvpn-53cbd13dac94cb74fdb0688c0abc92b32bb50bba.zip
Output app version directly from workflow step
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/desktop-e2e.yml57
1 files changed, 32 insertions, 25 deletions
diff --git a/.github/workflows/desktop-e2e.yml b/.github/workflows/desktop-e2e.yml
index 37d6c2b880..49b70dba66 100644
--- a/.github/workflows/desktop-e2e.yml
+++ b/.github/workflows/desktop-e2e.yml
@@ -153,16 +153,16 @@ jobs:
./dist/*.deb
./dist/app-e2e-*
- build-mullvad-version-linux:
- name: Build mullvad-version
+ get-app-version:
+ name: Get app version
needs: prepare-linux
runs-on: ubuntu-latest
+ outputs:
+ mullvad-version: ${{ steps.cargo-run.outputs.mullvad-version }}
container:
image: ${{ needs.prepare-linux.outputs.container_image }}
if: |
- !cancelled() &&
- needs.prepare-matrices.outputs.linux_matrix != '[]' &&
- needs.prepare-matrices.outputs.linux_matrix != ''
+ !cancelled()
steps:
# Fix for HOME path overridden by GH runners when building in containers, see:
# https://github.com/actions/runner/issues/863
@@ -170,19 +170,16 @@ jobs:
run: echo "HOME=/root" >> $GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@v4
- - name: Build mullvad-version
+ - name: Run mullvad-version
+ id: cargo-run
run: |
- cargo build --package mullvad-version --release
- # Move `mullvad-version` to a known location. This is needed in the coming `upload-artifact` step.
- mkdir bin
- mv -t ./bin/ "$CARGO_TARGET_DIR/release/mullvad-version"
+ # `mullvad-version` uses tags to compute the dev-suffix, so we must fetch them
+ git config --global --add safe.directory '*'
+ git fetch --tags --prune-tags --force > /dev/null
+ version=$(cargo run --package mullvad-version -q)
+ echo "Mullvad VPN app version: '$version'"
+ echo "mullvad-version=$version" >> "$GITHUB_OUTPUT"
shell: bash
- - name: Upload mullvad-version
- uses: actions/upload-artifact@v4
- with:
- name: mullvad-version-linux
- path: ./bin/mullvad-version
- if-no-files-found: error
# This step should always be run because the `test-manager` binary is used to compile the
# result matrix at the end! If that functionality is ever split out from the `test-manager`,
@@ -240,9 +237,17 @@ jobs:
e2e-test-linux:
name: Linux end-to-end tests
# yamllint disable-line rule:line-length
- needs: [prepare-matrices, build-linux-app, build-mullvad-version-linux, build-test-manager-linux, build-test-runner-binaries-linux]
+ needs:
+ [
+ prepare-matrices,
+ build-linux-app,
+ get-app-version,
+ build-test-manager-linux,
+ build-test-runner-binaries-linux,
+ ]
if: |
!cancelled() &&
+ needs.get-app-version.result == 'success' &&
needs.prepare-matrices.outputs.linux_matrix != '[]' &&
needs.prepare-matrices.outputs.linux_matrix != ''
runs-on: [self-hosted, desktop-test, Linux] # app-test-linux
@@ -266,11 +271,6 @@ jobs:
with:
name: linux-test-manager-build
path: ${{ github.workspace }}/bin
- - name: Download mullvad-version
- uses: actions/download-artifact@v4
- with:
- name: mullvad-version-linux
- path: ${{ github.workspace }}/bin
- name: Download Test Runner binaries
uses: actions/download-artifact@v4
if: ${{ needs.build-test-runner-binaries-linux.result == 'success' }}
@@ -289,6 +289,8 @@ jobs:
path: ~/.cache/mullvad-test/packages
- name: Run end-to-end tests
shell: bash -ieo pipefail {0}
+ env:
+ CURRENT_VERSION: ${{needs.get-app-version.outputs.mullvad-version}}
run: |
# A directory with all the binaries is required to run test-manager.
# The test scripts which runs in CI expects this folder to be available as the `TEST_DIST_DIR` variable.
@@ -296,7 +298,6 @@ jobs:
git fetch --tags --prune-tags --force
export TEST_FILTERS="${{ github.event.inputs.tests }}"
ls -la "$TEST_DIST_DIR"
- ${{ github.workspace }}/bin/mullvad-version
./test/scripts/run/ci.sh ${{ matrix.os }}
- name: Upload test report
uses: actions/upload-artifact@v4
@@ -360,9 +361,10 @@ jobs:
path: .\dist\*.exe
e2e-test-windows:
- needs: [prepare-matrices, build-windows]
+ needs: [prepare-matrices, build-windows, get-app-version]
if: |
!cancelled() &&
+ needs.get-app-version.result == 'success' &&
needs.prepare-matrices.outputs.windows_matrix != '[]' &&
needs.prepare-matrices.outputs.windows_matrix != ''
name: Windows end-to-end tests
@@ -383,6 +385,8 @@ jobs:
uses: actions/checkout@v4
- name: Run end-to-end tests
shell: bash -ieo pipefail {0}
+ env:
+ CURRENT_VERSION: ${{needs.get-app-version.outputs.mullvad-version}}
run: |
git fetch --tags --prune-tags --force
export TEST_FILTERS="${{ github.event.inputs.tests }}"
@@ -434,9 +438,10 @@ jobs:
./dist/app-e2e-*
e2e-test-macos:
- needs: [prepare-matrices, build-macos]
+ needs: [prepare-matrices, build-macos, get-app-version]
if: |
!cancelled() &&
+ needs.get-app-version.result == 'success' &&
needs.prepare-matrices.outputs.macos_matrix != '[]' &&
needs.prepare-matrices.outputs.macos_matrix != ''
name: macOS end-to-end tests
@@ -457,6 +462,8 @@ jobs:
uses: actions/checkout@v4
- name: Run end-to-end tests
shell: bash -ieo pipefail {0}
+ env:
+ CURRENT_VERSION: ${{needs.get-app-version.outputs.mullvad-version}}
run: |
git fetch --tags --prune-tags --force
export TEST_FILTERS="${{ github.event.inputs.tests }}"