test: build linux artifacts for e2e #65
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Desktop - End-to-end tests | |
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: | |
fail-fast: false | |
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: | |
fetch-tags: true | |
- name: Run end-to-end tests | |
shell: bash -ieo pipefail {0} | |
run: | | |
./test/ci-runtests.sh ${{ matrix.os }} | |
- uses: actions/upload-artifact@v3 | |
if: '!cancelled()' | |
with: | |
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 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows10, windows11] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-tags: true | |
- name: Run end-to-end tests | |
shell: bash -ieo pipefail {0} | |
run: | | |
./test/ci-runtests.sh ${{ matrix.os }} | |
- uses: actions/upload-artifact@v3 | |
if: '!cancelled()' | |
with: | |
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 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-14, macos-13, macos-12] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-tags: true | |
- name: Run end-to-end tests | |
shell: bash -ieo pipefail {0} | |
run: | | |
./test/ci-runtests.sh ${{ matrix.os }} | |
- uses: actions/upload-artifact@v3 | |
if: '!cancelled()' | |
with: | |
name: ${{ matrix.os }}_report | |
path: ./test/.ci-logs/${{ matrix.os }}_report | |
compile-test-matrix: | |
name: Result matrix | |
needs: [e2e-test-linux, e2e-test-windows, e2e-test-macos] | |
if: '!cancelled()' | |
runs-on: [self-hosted, desktop-test, Linux] | |
timeout-minutes: 240 | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
path: ./test/.ci-logs/artifacts | |
- name: Generate test result matrix | |
shell: bash -ieo pipefail {0} | |
run: | | |
cd test | |
# "Unpack" the downloaded report artifacts: https://github.com/actions/download-artifact/issues/141 | |
cp ./.ci-logs/artifacts/*_report/*_report ./.ci-logs/ | |
cargo run --bin test-manager format-test-reports ./.ci-logs/*_report \ | |
| tee summary.html >> $GITHUB_STEP_SUMMARY | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: summary.html | |
path: test/summary.html |