Repository navigation
Run the ISO end-to-end tests in their own container #46
Workflow file for this run
This file contains hidden or 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
| # Builds the unattended Ubuntu ISO and installs it from UEFI USB media in QEMU. | |
| # It completes the required reboots and verifies the installed DAppNode system. | |
| # | |
| # Runs on our archive-1 org runners. Pull requests from forks use | |
| # ubuntu-latest instead, so outside code never runs on our machines. | |
| # The runner needs only Docker and /dev/kvm: the test runs in a container of its | |
| # own (test/e2e_in_docker.sh), so it needs no sudo and leaves nothing on the host. | |
| name: Ubuntu unattended USB ISO end-to-end | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| # Weekly run against master to catch breakage from upstream package changes. | |
| schedule: | |
| - cron: "0 7 * * 1" | |
| timezone: "Europe/Madrid" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ubuntu-iso-e2e-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| install: | |
| name: Install Ubuntu unattended ISO via UEFI USB | |
| runs-on: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) && 'ubuntu-latest' || 'archive-1' }} | |
| timeout-minutes: 90 | |
| env: | |
| # A Compose project per run, so parallel ISO builds on one Docker host never | |
| # share or remove each other's installer container. | |
| COMPOSE_PROJECT_NAME: dappnode-iso-${{ github.run_id }}-${{ github.run_attempt }} | |
| steps: | |
| # A cancelled run on a self-hosted runner can leave root-owned build output | |
| # that would stop checkout from cleaning the workspace. | |
| - name: Reclaim the workspace | |
| run: docker run --rm -v "${GITHUB_WORKSPACE}:/workspace" ubuntu:24.04 chown -R "$(id -u):$(id -g)" /workspace | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Build Ubuntu unattended ISO | |
| run: | | |
| export BASE_OS=ubuntu | |
| export UNATTENDED=true | |
| # Retry so a transient mirror outage does not fail the whole E2E run. | |
| for attempt in 1 2 3; do | |
| docker compose up --build --abort-on-container-exit --exit-code-from dappnode_installer && break | |
| [ "${attempt}" -lt 3 ] || exit 1 | |
| echo "::warning::ISO build attempt ${attempt} failed; retrying in 30s" | |
| sleep 30 | |
| done | |
| ls -lrt images/Dappnode-ubuntu-*.iso | |
| - name: Complete Ubuntu unattended UEFI USB installation | |
| env: | |
| E2E_BOOT_MODE: usb | |
| E2E_FIRMWARE: uefi | |
| E2E_NETWORK_STATE_DIR: ${{ github.workspace }}/test-output/ubuntu-e2e/network | |
| run: | | |
| ubuntu_iso=$(find images -maxdepth 1 -type f -name 'Dappnode-ubuntu-*-live-server-amd64.iso' -print -quit) | |
| test -n "${ubuntu_iso}" | |
| bash test/e2e_in_docker.sh test/e2e_ubuntu_iso.sh "${ubuntu_iso}" | |
| - name: Upload installation logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ubuntu-unattended-usb-installation-logs | |
| path: test-output/ubuntu-e2e/ | |
| if-no-files-found: ignore | |
| retention-days: 7 | |
| # A self-hosted runner keeps its workspace and Docker state between jobs. | |
| - name: Remove the build output | |
| if: always() | |
| run: | | |
| # Only this run's installer container, network and image; the image is | |
| # rebuilt from the checkout, so each commit would otherwise leave one behind. | |
| docker compose down --rmi local --remove-orphans || true | |
| # The ISO build writes as root, so remove its output as root too. | |
| docker run --rm -v "${GITHUB_WORKSPACE}:/workspace" ubuntu:24.04 rm -rf /workspace/images /workspace/test-output |