mirror of
https://github.com/software-mansion/argent.git
synced 2026-09-14 19:27:14 +08:00
05e619e55d
## What `wayland-e2e.yml` boots an Android AVD on Linux under headless Weston and asserts the full pipeline works without a display. It guards exactly one cell of the support matrix. This adds the same boot→screenshot→gesture-tap smoke test for every other (target × host) cell that can run on GitHub-hosted runners. | target | host | job | status | |---|---|---|---| | Android emulator | Linux (KVM) | `wayland-e2e.yml` (existing) | ✅ | | iOS simulator | macOS | `ios-sim-macos` | ✅ | | Chromium / Electron | Linux (Xvfb) | `chromium-linux` | ✅ | | Chromium / Electron | macOS | `chromium-macos` | ✅ | ## How - **`scripts/e2e/drive-device.sh`** — shared driver. Boots one device through the tool-server, then asserts `booted:true` → screenshot has real (non-blank) pixels → `gesture-tap` round-trips. Every tool takes the device id as `udid` and screenshots come back as the same `data.image.hostPath` envelope on all platforms, so the body is uniform; each job just supplies the cell-specific boot JSON + device id. - **`packages/tool-server/test/fixtures/electron-smoke-app/`** — minimal self-contained Electron app the Chromium jobs point `electronAppPath` at. It vendors its own electron via its own lockfile (kept out of the repo root lockfile); CI `npm ci`s it so `boot-electron` resolves `./node_modules/.bin/electron`. - **`.github/workflows/e2e-device-smoke.yml`** — three jobs, `workflow_dispatch` + path-filtered `pull_request`. iOS downloads the darwin native binaries (injection must succeed for `bootIos` to report `booted:true`); Chromium-Linux runs under Xvfb with `--no-sandbox`. The tool-server is started with `TS_NODE_TRANSPILE_ONLY=1` so cold ts-node startup doesn't flakily exceed the readiness poll on loaded macOS runners (types are still enforced by the typecheck job). ## Known gaps (supported on real machines, not runnable on hosted runners) - **Android emulator on macOS** — the arm64 emulator needs HVF (`-enable-hvf`), but hosted macOS runners are themselves VMs with no nested virtualization. Confirmed by running it: qemu dies with `HVF error: HV_UNSUPPORTED` ~18s into boot, regardless of GPU mode or RAM. The Android boot/screenshot/tap path is already regression-guarded on Linux via KVM (`wayland-e2e.yml`), so macOS adds no runnable coverage. - **Physical devices** — real iOS (CoreDevice HID) and real Android (adb-USB) have no attached hardware on hosted runners. Both would need self-hosted runners (a Mac exposing HVF / wired-up devices). Documented in the workflow header. ## Verification - All checks green: the 3 device jobs + ESLint + Prettier + Unit tests. - Locally (before CI): ran `drive-device.sh` end-to-end against a real tool-server → boot `booted:true`, screenshot **142 KB** (floor 20 KB), tap `tapped:true`, exit 0; and confirmed via the Argent stack that a tap at (0.5, 0.5) lands on the fixture's centered button and increments its counter.
59 lines
2.3 KiB
YAML
59 lines
2.3 KiB
YAML
name: Start tool-server
|
|
description: >-
|
|
Install dependencies, build the TypeScript, and start the Argent tool-server
|
|
in the background, polling until it answers on /tools. Shared by every
|
|
e2e-device-smoke job so the install/build boilerplate and the
|
|
TS_NODE_TRANSPILE_ONLY / port / readiness-poll logic live in exactly one place.
|
|
|
|
inputs:
|
|
node-version:
|
|
description: Node.js version to set up.
|
|
required: false
|
|
default: "20"
|
|
port:
|
|
description: Port the tool-server binds to (ARGENT_PORT) and the readiness poll hits.
|
|
required: false
|
|
default: "3033"
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: ${{ inputs.node-version }}
|
|
|
|
- name: Install deps + build
|
|
shell: bash
|
|
run: |
|
|
npm ci
|
|
# Rollup's native binary ships as an optional dep that npm can skip
|
|
# (npm/cli#4828); install the one matching this runner explicitly so the
|
|
# tsc bundling step doesn't fail with "Cannot find module @rollup/rollup-*".
|
|
# RUNNER_OS is provided by GitHub Actions (Linux / macOS / Windows).
|
|
case "$RUNNER_OS" in
|
|
macOS) npm install @rollup/rollup-darwin-arm64 --no-save ;;
|
|
Linux) npm install @rollup/rollup-linux-x64-gnu --no-save ;;
|
|
*) echo "::error::start-tool-server: unsupported runner OS '$RUNNER_OS'"; exit 1 ;;
|
|
esac
|
|
npx tsc --build
|
|
|
|
- name: Start tool-server
|
|
shell: bash
|
|
env:
|
|
ARGENT_PORT: ${{ inputs.port }}
|
|
run: |
|
|
mkdir -p ~/.argent
|
|
: > ~/.argent/tool-server.log
|
|
cd packages/tool-server
|
|
# TS_NODE_TRANSPILE_ONLY skips ts-node's whole-program type-check (the
|
|
# typecheck job already enforces types). Without it a cold start on a
|
|
# loaded CI runner can take >60s to bind and flakily times out.
|
|
nohup env ARGENT_PORT="$ARGENT_PORT" TS_NODE_TRANSPILE_ONLY=1 npx ts-node src/index.ts start \
|
|
> ~/.argent/tool-server.log 2>&1 &
|
|
for i in $(seq 1 60); do
|
|
curl -s -o /dev/null -w "%{http_code}" "http://127.0.0.1:${ARGENT_PORT}/tools" | grep -q 200 \
|
|
&& { echo "tool-server up t+${i}s"; exit 0; }
|
|
sleep 1
|
|
done
|
|
echo "tool-server failed to start"; cat ~/.argent/tool-server.log; exit 1
|