# Steamify's own VM tests on GitHub's runners (4 vCPUs, 16 GB, KVM; skipped on the Gitea mirror): the same as # `scripts/vmtest.sh` in steamify-cachyos-dev, on this commit's steamify.sh. The base is the newest Steamify ISO # release (steamify-cachyos-live-iso, built and kept on the git.upriser.nl mirror: GitHub releases take at # most 2 GB per file): the boot loader tests (limine, systemd-boot, grub) install it with this commit's # Steamify, then the suites (cli, menu, hw, installer, toggles) run on a plain VM from the same ISO (its # Steamify step skipped: the suites start from a system without Steamify). # Needs the secret GIT_UPRISER_URL (the mirror's address, for the ISO). Two VMs at a time, 2 vCPUs each. name: Steamify VM tests on: push: branches: [main, 'release/**'] pull_request: workflow_dispatch: # A new run on the same branch or pull request stops the old one. concurrency: group: vmtest-${{ github.ref }} cancel-in-progress: true jobs: iso: name: Newest Steamify ISO if: github.server_url == 'https://github.com' runs-on: ubuntu-latest outputs: tag: ${{ steps.find.outputs.tag }} url: ${{ steps.find.outputs.url }} steps: - name: Find the newest ISO release on the mirror id: find env: MIRROR: ${{ secrets.GIT_UPRISER_URL }} run: | [ -n "$MIRROR" ] || { echo "::error::the secret GIT_UPRISER_URL is not set"; exit 1; } read -r tag url < <(curl -fsS "${MIRROR%/}/api/v1/repos/theupriser/steamify-cachyos-live-iso/releases?limit=20" | python3 -c ' import json, sys for r in json.load(sys.stdin): for a in r["assets"]: if a["name"].endswith(".iso"): print(r["tag_name"], a["browser_download_url"]); raise SystemExit ') [ -n "$tag" ] || { echo "::error::no ISO release on the mirror"; exit 1; } echo "Using $tag" { echo "tag=$tag"; echo "url=$url"; } >> "$GITHUB_OUTPUT" boot: name: Boot loader ${{ matrix.loader }} needs: iso runs-on: ubuntu-latest timeout-minutes: 120 strategy: fail-fast: false # One job per boot loader, two VMs at a time (16 GB of RAM). max-parallel: 2 matrix: loader: [limine, systemd-boot, grub] steps: - uses: actions/checkout@v4 with: path: steamify-cachyos - uses: actions/checkout@v4 with: repository: theupriser/steamify-cachyos-dev path: steamify-cachyos-dev - name: Runner setup (KVM, qemu, disk) run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules sudo udevadm control --reload-rules && sudo udevadm trigger --name-match=kvm [ -w /dev/kvm ] || { echo "::error::no usable /dev/kvm on this runner"; exit 1; } sudo apt-get update -qq sudo apt-get install -y -qq qemu-system-x86 qemu-utils ovmf libarchive-tools openssh-client # The VMs and the ISO on /mnt (the big disk); ~/vms points there. sudo mkdir -p /mnt/work && sudo chown "$USER" /mnt/work mkdir -p /mnt/work/vms/pkg-cache /mnt/work/iso && ln -s /mnt/work/vms "$HOME/vms" nproc; free -g | sed -n 2p; df -h /mnt | tail -n 1 - name: Cache - the VMs' packages uses: actions/cache@v4 with: path: /mnt/work/vms/pkg-cache key: vmpkg-${{ github.run_id }} restore-keys: vmpkg- - name: Cache - the ISO uses: actions/cache@v4 with: path: /mnt/work/iso key: steamify-iso-${{ needs.iso.outputs.tag }} - name: ISO env: URL: ${{ needs.iso.outputs.url }} run: | [ -n "$(ls /mnt/work/iso/*.iso 2>/dev/null)" ] || curl -fL --retry 5 --retry-all-errors -o /mnt/work/iso/steamify.iso "$URL" - name: Boot loader test (${{ matrix.loader }}) env: CI: "1" VM_TIMEZONE: UTC VM_CPUS: "2" VM_INSTALL_MEM: 6G run: | ssh-keygen -q -t ed25519 -N "" -C steamify-vm -f ~/.ssh/steamify-vm_ed25519 <<< "" || true cd steamify-cachyos-dev VM_ISO=/mnt/work/iso/steamify.iso scripts/vmbootloadertest.sh "${{ matrix.loader }}" --install - name: Logs if: always() uses: actions/upload-artifact@v4 with: name: boot-${{ matrix.loader }} path: | /mnt/work/vms/bl-${{ matrix.loader }}.test.log /mnt/work/vms/bl-${{ matrix.loader }}/vm.log retention-days: 7 if-no-files-found: ignore suites: name: Suites (vmtest.sh) needs: [iso, boot] runs-on: ubuntu-latest timeout-minutes: 240 steps: - uses: actions/checkout@v4 with: path: steamify-cachyos - uses: actions/checkout@v4 with: repository: theupriser/steamify-cachyos-dev path: steamify-cachyos-dev # vmtest.sh reads which boot loaders the ISO advertises from this repository. - uses: actions/checkout@v4 with: repository: theupriser/steamify-cachyos-live-iso path: steamify-cachyos-live-iso - name: Runner setup (KVM, qemu, disk) run: | echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules sudo udevadm control --reload-rules && sudo udevadm trigger --name-match=kvm [ -w /dev/kvm ] || { echo "::error::no usable /dev/kvm on this runner"; exit 1; } sudo apt-get update -qq sudo apt-get install -y -qq qemu-system-x86 qemu-utils ovmf libarchive-tools openssh-client sudo mkdir -p /mnt/work && sudo chown "$USER" /mnt/work mkdir -p /mnt/work/vms/pkg-cache /mnt/work/iso && ln -s /mnt/work/vms "$HOME/vms" nproc; free -g | sed -n 2p; df -h /mnt | tail -n 1 - name: Cache - the VMs' packages uses: actions/cache@v4 with: path: /mnt/work/vms/pkg-cache key: vmpkg-${{ github.run_id }} restore-keys: vmpkg- - name: Cache - the ISO uses: actions/cache@v4 with: path: /mnt/work/iso key: steamify-iso-${{ needs.iso.outputs.tag }} - name: ISO env: URL: ${{ needs.iso.outputs.url }} run: | [ -n "$(ls /mnt/work/iso/*.iso 2>/dev/null)" ] || curl -fL --retry 5 --retry-all-errors -o /mnt/work/iso/steamify.iso "$URL" - name: Base VM from the ISO env: CI: "1" VM_TIMEZONE: UTC VM_CPUS: "2" VM_INSTALL_MEM: 6G VM_STEAMIFY: skip run: | ssh-keygen -q -t ed25519 -N "" -C steamify-vm -f ~/.ssh/steamify-vm_ed25519 <<< "" || true cd steamify-cachyos-dev VM_DIR="$HOME/vms/steamify-vm" scripts/vminstall.sh --iso /mnt/work/iso/steamify.iso - name: vmtest.sh (every suite) env: CI: "1" VM_CPUS: "2" MAX_PARALLEL: "2" run: | cd steamify-cachyos-dev scripts/vmtest.sh cli menu hw installer toggles - name: Logs if: always() uses: actions/upload-artifact@v4 with: name: suites path: | /mnt/work/vms/last-test.txt /mnt/work/vms/run-*.log retention-days: 7 if-no-files-found: ignore