VM end-to-end test #3
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
| name: VM end-to-end test | |
| # Boots Valve's real recovery image in a VM and installs SteamOS onto a virtual | |
| # disk, end to end. This is the only test that covers steamos-chroot, the btrfs | |
| # rootfs copy and the bootloader install - and it is how the two bugs fixed in | |
| # c4d9b23 were found. | |
| # | |
| # It needs KVM, ~25 GB of disk and about 30 minutes, so it does NOT run on | |
| # GitHub's hosted runners. Point it at a self-hosted runner with KVM, or run | |
| # tools/vm-test/run-vm-test.sh by hand on any Linux box with libvirt: | |
| # | |
| # sudo tools/vm-test/run-vm-test.sh | |
| # | |
| # See tools/vm-test/README.md. | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| build: | |
| description: "Recovery build to test against (blank = the pinned default)" | |
| required: false | |
| type: string | |
| permissions: | |
| contents: read | |
| jobs: | |
| vm-test: | |
| name: install into a VM from the real recovery image | |
| # Requires a self-hosted runner labelled 'kvm'. With no such runner the job | |
| # simply stays queued and is cancelled - it never reports a false failure. | |
| runs-on: [self-hosted, linux, kvm] | |
| timeout-minutes: 90 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Run the end-to-end VM test | |
| # VM_TEST_WORKDIR is set by the runner: it must be a path that exists | |
| # identically on the libvirt host, since libvirt resolves the disk | |
| # images there. It must not be RAM-backed - see the script's guard. | |
| run: | | |
| WORKDIR="${VM_TEST_WORKDIR:-/var/tmp/steamos-vm-test}" | |
| echo "VM_TEST_WORKDIR=$WORKDIR" >> "$GITHUB_ENV" | |
| sudo --preserve-env=VM_TEST_WORKDIR,OVMF_CODE,OVMF_VARS \ | |
| tools/vm-test/run-vm-test.sh \ | |
| --workdir "$WORKDIR" \ | |
| ${{ inputs.build && format('--build {0}', inputs.build) || '' }} | |
| # Copy the log into the workspace first. The work directory lives outside | |
| # it and is only known at run time, and upload-artifact cannot see a | |
| # runner process env var through the ${{ env }} context. | |
| - name: Collect the guest console log | |
| if: always() | |
| run: | | |
| cp "${VM_TEST_WORKDIR:-/var/tmp/steamos-vm-test}/console.log" vm-console.log 2>/dev/null \ | |
| || echo "no console log produced" > vm-console.log | |
| wc -l vm-console.log | |
| - name: Publish the guest console log | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vm-console-log | |
| path: vm-console.log | |
| if-no-files-found: warn |