ci: VM tests: one job per boot loader and per suite, all parallel on their own GitHub runners; the ISO is fetched once and cached

This commit is contained in:
theupriser committed 2026-09-30 09:34:53 +02:00
1 parent 5c0cd7aa92
commit ec993eca33
2 files changed
+67 -65

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
name: VM runner
description: KVM, qemu, the big disk for the VMs, the package cache and the cached Steamify ISO (at /mnt/work/iso/steamify.iso)
inputs:
iso-tag:
description: The Steamify ISO release the iso job cached
required: true
runs:
using: composite
steps:
- name: KVM, qemu, disk
shell: bash
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 "$HOME/.ssh" && ln -s /mnt/work/vms "$HOME/vms"
ssh-keygen -q -t ed25519 -N "" -C steamify-vm -f "$HOME/.ssh/steamify-vm_ed25519"
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 }}-${{ github.job }}-${{ strategy.job-index }}
restore-keys: vmpkg-
- name: Cache - the ISO (from the iso job)
uses: actions/cache/restore@v4
with:
path: /mnt/work/iso
key: steamify-iso-${{ inputs.iso-tag }}
fail-on-cache-miss: true
+33 -65
View File
@@ -4,7 +4,8 @@
# most 2 GB per file): the boot loader tests (limine, systemd-boot, grub) install it with this commit's # 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, 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). # 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. # The ISO is fetched once (the iso job, cached) and restored by the others.
# Needs the secret GIT_UPRISER_URL (the mirror's address, for the ISO). Every job has its own runner, so everything runs in parallel: one job per boot loader and per suite, each with its own VMs (2 vCPUs, 4-6 GB).
name: Steamify VM tests name: Steamify VM tests
on: on:
@@ -25,7 +26,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
tag: ${{ steps.find.outputs.tag }} tag: ${{ steps.find.outputs.tag }}
url: ${{ steps.find.outputs.url }}
steps: steps:
- name: Find the newest ISO release on the mirror - name: Find the newest ISO release on the mirror
id: find id: find
@@ -43,6 +43,20 @@ jobs:
[ -n "$tag" ] || { echo "::error::no ISO release on the mirror"; exit 1; } [ -n "$tag" ] || { echo "::error::no ISO release on the mirror"; exit 1; }
echo "Using $tag" echo "Using $tag"
{ echo "tag=$tag"; echo "url=$url"; } >> "$GITHUB_OUTPUT" { echo "tag=$tag"; echo "url=$url"; } >> "$GITHUB_OUTPUT"
- name: Cache - the ISO
id: cache
uses: actions/cache@v4
with:
path: /mnt/work/iso
key: steamify-iso-${{ steps.find.outputs.tag }}
env:
ISO_DIR: /mnt/work/iso
- name: Download the ISO (once for every job)
if: steps.cache.outputs.cache-hit != 'true'
run: |
sudo mkdir -p /mnt/work/iso && sudo chown -R "$USER" /mnt/work
curl -fL --retry 5 --retry-all-errors -o /mnt/work/iso/steamify.iso "${{ steps.find.outputs.url }}"
ls -la /mnt/work/iso
boot: boot:
name: Boot loader ${{ matrix.loader }} name: Boot loader ${{ matrix.loader }}
@@ -51,8 +65,6 @@ jobs:
timeout-minutes: 120 timeout-minutes: 120
strategy: strategy:
fail-fast: false fail-fast: false
# One job per boot loader, two VMs at a time (16 GB of RAM).
max-parallel: 2
matrix: matrix:
loader: [limine, systemd-boot, grub] loader: [limine, systemd-boot, grub]
steps: steps:
@@ -63,41 +75,16 @@ jobs:
with: with:
repository: theupriser/steamify-cachyos-dev repository: theupriser/steamify-cachyos-dev
path: steamify-cachyos-dev path: steamify-cachyos-dev
- name: Runner setup (KVM, qemu, disk) - uses: ./steamify-cachyos/.github/actions/vm-runner
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: with:
path: /mnt/work/vms/pkg-cache iso-tag: ${{ needs.iso.outputs.tag }}
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 }}) - name: Boot loader test (${{ matrix.loader }})
env: env:
CI: "1" CI: "1"
VM_TIMEZONE: UTC VM_TIMEZONE: UTC
VM_CPUS: "2" VM_CPUS: "4"
VM_INSTALL_MEM: 6G VM_INSTALL_MEM: 6G
run: | run: |
ssh-keygen -q -t ed25519 -N "" -C steamify-vm -f ~/.ssh/steamify-vm_ed25519 <<< "" || true
cd steamify-cachyos-dev cd steamify-cachyos-dev
VM_ISO=/mnt/work/iso/steamify.iso scripts/vmbootloadertest.sh "${{ matrix.loader }}" --install VM_ISO=/mnt/work/iso/steamify.iso scripts/vmbootloadertest.sh "${{ matrix.loader }}" --install
- name: Logs - name: Logs
@@ -112,10 +99,14 @@ jobs:
if-no-files-found: ignore if-no-files-found: ignore
suites: suites:
name: Suites (vmtest.sh) name: Suite ${{ matrix.suite }}
needs: [iso, boot] needs: iso
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 240 timeout-minutes: 180
strategy:
fail-fast: false
matrix:
suite: [toggles, hw, cli, 'menu installer']
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:
@@ -129,56 +120,33 @@ jobs:
with: with:
repository: theupriser/steamify-cachyos-live-iso repository: theupriser/steamify-cachyos-live-iso
path: steamify-cachyos-live-iso path: steamify-cachyos-live-iso
- name: Runner setup (KVM, qemu, disk) - uses: ./steamify-cachyos/.github/actions/vm-runner
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: with:
path: /mnt/work/vms/pkg-cache iso-tag: ${{ needs.iso.outputs.tag }}
key: vmpkg-${{ github.run_id }} # A plain VM for the suites: the ISO's installer with its Steamify step skipped (the suites start without Steamify).
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 - name: Base VM from the ISO
env: env:
CI: "1" CI: "1"
VM_TIMEZONE: UTC VM_TIMEZONE: UTC
VM_CPUS: "2" VM_CPUS: "4"
VM_INSTALL_MEM: 6G VM_INSTALL_MEM: 6G
VM_STEAMIFY: skip VM_STEAMIFY: skip
run: | run: |
ssh-keygen -q -t ed25519 -N "" -C steamify-vm -f ~/.ssh/steamify-vm_ed25519 <<< "" || true
cd steamify-cachyos-dev cd steamify-cachyos-dev
VM_DIR="$HOME/vms/steamify-vm" scripts/vminstall.sh --iso /mnt/work/iso/steamify.iso VM_DIR="$HOME/vms/steamify-vm" scripts/vminstall.sh --iso /mnt/work/iso/steamify.iso
- name: vmtest.sh (every suite) - name: vmtest.sh ${{ matrix.suite }}
env: env:
CI: "1" CI: "1"
VM_CPUS: "2" VM_CPUS: "2"
MAX_PARALLEL: "2" MAX_PARALLEL: "2"
run: | run: |
cd steamify-cachyos-dev cd steamify-cachyos-dev
scripts/vmtest.sh cli menu hw installer toggles scripts/vmtest.sh ${{ matrix.suite }}
- name: Logs - name: Logs
if: always() if: always()
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: suites name: suite-${{ strategy.job-index }}
path: | path: |
/mnt/work/vms/last-test.txt /mnt/work/vms/last-test.txt
/mnt/work/vms/run-*.log /mnt/work/vms/run-*.log