Skip to content

Commit 5dbaa2f

Browse files
committed
ci: probe headless Omarchy VM
1 parent 9b6f7b9 commit 5dbaa2f

4 files changed

Lines changed: 124 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Midscene experimental
2+
3+
on:
4+
push:
5+
branches: [ci/midscene-e2e]
6+
paths:
7+
- ".github/workflows/midscene-experimental.yml"
8+
- "tests/midscene/**"
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
concurrency:
15+
group: midscene-experimental-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
jobs:
19+
omarchy-vm:
20+
name: Install real Omarchy in a headless VM
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 70
23+
steps:
24+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
25+
with:
26+
persist-credentials: false
27+
28+
- name: Install Omarchy VM
29+
run: tests/midscene/install-omarchy-vm.sh
30+
31+
- name: Upload installer evidence
32+
if: always()
33+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
34+
with:
35+
name: omarchy-vm-installer-evidence
36+
path: .midscene-omarchy/omarchy-iso/test-runs/**/runs/**
37+
if-no-files-found: warn
38+
retention-days: 3
39+

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ settings.json
9090
/recordings/
9191
/screenshots/
9292
/backups/
93+
/.midscene-omarchy/
9394
*.bak
9495
*.orig
9596
*.rej

‎tests/midscene/README.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Midscene experimental branch
2+
3+
Everything under this directory is developed on `ci/midscene-e2e`; it is not
4+
part of the release branch.
5+
6+
The first CI stage proves that a GitHub-hosted runner can install the exact
7+
official Omarchy ISO in a headless QEMU/KVM VM. It reuses Omarchy's own ISO
8+
acceptance harness and saves installer screenshots and logs as short-lived
9+
artifacts. It does not upload the VM disk or its temporary SSH key.
10+
11+
After that probe is stable, the next stages are:
12+
13+
1. Boot a throwaway overlay from the installed base image.
14+
2. install and enable this checkout as `md.lifeos.doubao-say` in the guest.
15+
3. Run deterministic GTK UI fixtures with `@midscene/computer` on ordinary
16+
Ubuntu for every trusted change.
17+
4. Run a smaller Omarchy/Hyprland Midscene suite manually in the guest.
18+
19+
The AI stage needs a multimodal model credential. No local credential is
20+
copied into GitHub automatically, and tests must contain only synthetic data.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# This is deliberately a real Omarchy installation, not an Arch container
5+
# dressed up with a few Omarchy files. The official ISO acceptance harness
6+
# drives the installer through QEMU screenshots, OCR and virtual keystrokes.
7+
readonly ISO_VERSION="4.0.3"
8+
readonly ISO_SHA256="03d60bc74306dca51f96e1a84b690871d8d606826b260edd0208962da8507d14"
9+
readonly ISO_HARNESS_SHA="a23f8d464dcb0616a61bfaa8026e23d0533da209"
10+
readonly WORK_DIR="$PWD/.midscene-omarchy"
11+
readonly ISO_PATH="$WORK_DIR/omarchy-${ISO_VERSION}.iso"
12+
readonly HARNESS_DIR="$WORK_DIR/omarchy-iso"
13+
14+
if [[ ! -c /dev/kvm ]]; then
15+
echo "::error::This GitHub runner does not expose /dev/kvm; a real Omarchy VM cannot be started."
16+
exit 1
17+
fi
18+
19+
sudo chmod 0666 /dev/kvm
20+
21+
# The ISO is about 6 GB and the installed qcow2 image is sparse but sizeable.
22+
# GitHub's image includes large SDKs that this isolated job does not need.
23+
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc
24+
sudo apt-get update
25+
sudo apt-get install -y --no-install-recommends \
26+
curl git imagemagick ovmf qemu-system-x86 qemu-utils socat \
27+
tesseract-ocr tesseract-ocr-eng
28+
29+
mkdir -p "$WORK_DIR"
30+
df -h "$WORK_DIR"
31+
32+
curl --fail --location --retry 5 --retry-all-errors \
33+
"https://iso.omarchy.org/omarchy-${ISO_VERSION}.iso" \
34+
--output "$ISO_PATH"
35+
printf '%s %s\n' "$ISO_SHA256" "$ISO_PATH" | sha256sum --check --strict
36+
37+
git init --quiet "$HARNESS_DIR"
38+
git -C "$HARNESS_DIR" remote add origin https://github.com/omacom/omarchy-iso.git
39+
git -C "$HARNESS_DIR" fetch --quiet --depth 1 origin "$ISO_HARNESS_SHA"
40+
git -C "$HARNESS_DIR" checkout --quiet --detach FETCH_HEAD
41+
42+
# The official harness names Arch paths and its package helper. Adapt only
43+
# those host-side dependencies; the guest still boots and installs the exact
44+
# verified official ISO.
45+
sudo mkdir -p /usr/share/edk2/x64
46+
sudo ln -sf /usr/share/OVMF/OVMF_CODE_4M.fd /usr/share/edk2/x64/OVMF_CODE.4m.fd
47+
sudo ln -sf /usr/share/OVMF/OVMF_VARS_4M.fd /usr/share/edk2/x64/OVMF_VARS.4m.fd
48+
49+
readonly SHIM_DIR="$(mktemp -d)"
50+
trap 'rm -rf "$SHIM_DIR"' EXIT
51+
printf '#!/bin/sh\nexit 0\n' >"$SHIM_DIR/omarchy-pkg-add"
52+
printf '#!/bin/sh\nexec convert "$@"\n' >"$SHIM_DIR/magick"
53+
chmod 0755 "$SHIM_DIR/omarchy-pkg-add" "$SHIM_DIR/magick"
54+
55+
PATH="$SHIM_DIR:$PATH" "$HARNESS_DIR/bin/omarchy-iso-test" \
56+
"$ISO_PATH" \
57+
--install-only \
58+
--memory 4096 \
59+
--timeout 3000 \
60+
--no-preview
61+
62+
test -s "$HARNESS_DIR/test-runs/omarchy-${ISO_VERSION}/base.qcow2"
63+
echo "PASS: a complete Omarchy ${ISO_VERSION} base VM was installed on the GitHub runner"
64+

0 commit comments

Comments
 (0)