From 80ac985928700169bc629ec2896953b0b2c5d50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20L=C3=B6nnhager?= Date: Sat, 28 Oct 2023 12:19:35 +0200 Subject: [PATCH] test: build linux artifacts for e2e --- .github/workflows/desktop-e2e.yml | 62 +++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/.github/workflows/desktop-e2e.yml b/.github/workflows/desktop-e2e.yml index 3a2512e1c53f..0105ddcb0dc3 100644 --- a/.github/workflows/desktop-e2e.yml +++ b/.github/workflows/desktop-e2e.yml @@ -3,9 +3,62 @@ on: schedule: - cron: '0 0 * * *' workflow_dispatch: + # TEMP + push: jobs: + prepare-linux: + # TODO: only run if this is neither main nor a tag + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Use custom container image if specified + if: ${{ github.event.inputs.override_container_image != '' }} + run: echo "inner_container_image=${{ github.event.inputs.override_container_image }}" + >> $GITHUB_ENV + - name: Use default container image and resolve digest + if: ${{ github.event.inputs.override_container_image == '' }} + run: | + echo "inner_container_image=$(cat ./building/linux-container-image.txt)" >> $GITHUB_ENV + outputs: + container_image: ${{ env.inner_container_image }} + build-linux: + # TODO: only run if this is neither main nor a tag + needs: prepare-linux + runs-on: ubuntu-latest + container: + image: ${{ needs.prepare-linux.outputs.container_image }} + continue-on-error: true + steps: + # Fix for HOME path overridden by GH runners when building in containers, see: + # https://github.com/actions/runner/issues/863 + - name: Fix HOME path + run: echo "HOME=/root" >> $GITHUB_ENV + - name: Checkout repository + uses: actions/checkout@v3 + - name: Checkout binaries submodule + run: | + git config --global --add safe.directory '*' + git submodule update --init --depth=1 dist-assets/binaries + - name: Build app + env: + USE_MOLD: false + run: ./build.sh + - name: Build test executable + run: ./gui/scripts/build-test-executable.sh + - uses: actions/upload-artifact@v3 + if: '!cancelled()' + with: + name: linux-build + path: | + ./dist/*.rpm + ./dist/*.deb + ./dist/app-e2e-* + e2e-test-linux: name: Linux end-to-end tests + needs: build-linux + if: '!cancelled()' runs-on: [self-hosted, desktop-test, Linux] # app-test-linux timeout-minutes: 240 strategy: @@ -13,6 +66,11 @@ jobs: matrix: os: [debian11, debian12, ubuntu2004, ubuntu2204, ubuntu2304, fedora38, fedora37, fedora36] steps: + # TODO: only if ref is not tag + - uses: actions/download-artifact@v3 + with: + name: linux-build + path: ~/.cache/mullvad-test/packages - name: Checkout repository uses: actions/checkout@v4 with: @@ -27,6 +85,8 @@ jobs: name: ${{ matrix.os }}_report path: ./test/.ci-logs/${{ matrix.os }}_report e2e-test-windows: + # TEMP + if: false name: Windows end-to-end tests runs-on: [self-hosted, desktop-test, Linux] # app-test-linux timeout-minutes: 240 @@ -49,6 +109,8 @@ jobs: name: ${{ matrix.os }}_report path: ./test/.ci-logs/${{ matrix.os }}_report e2e-test-macos: + # TEMP + if: false name: macOS end-to-end tests runs-on: [self-hosted, desktop-test, macOS] # app-test-macos-arm timeout-minutes: 240