|
| 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