Skip to content

Commit 919013d

Browse files
committed
ci(image-tests): Layer 1 boot tests on GitHub KVM + gated Agent-S
Matrix runs edition boot nixosTests on ubuntu-latest (x86_64) and ubuntu-24.04-arm (aarch64) with KVM enabled — free, deterministic, on PR+push. Agent-S GUI job is workflow_dispatch + run_agent_s gated (needs ANTHROPIC_API_KEY + AS_GROUND_URL); builds the desktop qcow2 and runs the harness.
1 parent 4e49f58 commit 919013d

1 file changed

Lines changed: 89 additions & 0 deletions

File tree

.github/workflows/image-tests.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Image tests — validate that SourceOS editions actually boot.
2+
# Layer 1 (always): deterministic nixosTests in QEMU/KVM on GitHub runners.
3+
# Layer 2 (opt-in): Agent-S GUI test — needs a grounding endpoint + key, so
4+
# it's gated and expects those to be provided.
5+
name: image-tests
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
run_agent_s:
11+
description: 'Also run the Agent-S GUI test (needs AS_GROUND_URL + ANTHROPIC_API_KEY)'
12+
required: false
13+
default: false
14+
type: boolean
15+
pull_request:
16+
paths:
17+
- 'profiles/**'
18+
- 'flake.nix'
19+
- 'tests/editions/**'
20+
- '.github/workflows/image-tests.yml'
21+
push:
22+
branches: [main]
23+
paths:
24+
- 'profiles/**'
25+
- 'tests/editions/**'
26+
27+
jobs:
28+
# ── Layer 1: deterministic boot tests (free, KVM on GitHub) ──────────────────
29+
boot-tests:
30+
name: boot ${{ matrix.check }} (${{ matrix.arch }})
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
include:
35+
- { arch: x86_64, runner: ubuntu-latest, check: edition-desktop-boot }
36+
- { arch: x86_64, runner: ubuntu-latest, check: edition-server-boot }
37+
- { arch: x86_64, runner: ubuntu-latest, check: edition-edge-boot }
38+
- { arch: aarch64, runner: ubuntu-24.04-arm, check: edition-server-boot }
39+
- { arch: aarch64, runner: ubuntu-24.04-arm, check: edition-edge-boot }
40+
runs-on: ${{ matrix.runner }}
41+
timeout-minutes: 90
42+
steps:
43+
- uses: actions/checkout@v4
44+
- name: Enable KVM
45+
run: |
46+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
47+
| sudo tee /etc/udev/rules.d/99-kvm4all.rules >/dev/null
48+
sudo udevadm control --reload-rules && sudo udevadm trigger --name-match=kvm || true
49+
ls -l /dev/kvm || echo "no /dev/kvm (test will use slower TCG)"
50+
- uses: DeterminateSystems/nix-installer-action@v14
51+
- uses: DeterminateSystems/magic-nix-cache-action@v8
52+
- name: Free disk space
53+
run: sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android || true; df -h
54+
- name: Run boot test
55+
run: |
56+
nix build ".#checks.${{ matrix.arch }}-linux.${{ matrix.check }}" \
57+
--print-build-logs --show-trace -L
58+
59+
# ── Layer 2: Agent-S GUI test (opt-in, needs grounding endpoint + key) ───────
60+
agent-s:
61+
name: Agent-S GUI test
62+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.run_agent_s == 'true'
63+
runs-on: ubuntu-latest
64+
timeout-minutes: 90
65+
steps:
66+
- uses: actions/checkout@v4
67+
- uses: DeterminateSystems/nix-installer-action@v14
68+
- uses: DeterminateSystems/magic-nix-cache-action@v8
69+
- name: Enable KVM
70+
run: |
71+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' \
72+
| sudo tee /etc/udev/rules.d/99-kvm4all.rules >/dev/null
73+
sudo udevadm control --reload-rules && sudo udevadm trigger --name-match=kvm || true
74+
- name: Build desktop image + harness deps
75+
run: |
76+
nix build .#packages.x86_64-linux.sourceos-image-qcow2-desktop --print-build-logs
77+
sudo apt-get update -qq
78+
sudo apt-get install -y -qq xvfb x11vnc tigervnc-viewer qemu-system-x86 python3-pip
79+
pip install -r tests/agent-s/requirements.txt
80+
- name: Run Agent-S GUI test
81+
env:
82+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
83+
AS_GROUND_URL: ${{ secrets.AS_GROUND_URL }} # external UI-TARS endpoint
84+
run: |
85+
IMG=$(find -L result -name '*.qcow2' | head -1) \
86+
bash tests/agent-s/harness.sh
87+
- uses: actions/upload-artifact@v4
88+
if: always()
89+
with: { name: agent-s-artifacts, path: tests/agent-s/artifacts/*, if-no-files-found: ignore }

0 commit comments

Comments
 (0)