Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

ci(pro): build the Harness Pro firmware and check its golden screens on PR (#1421)

0xdiego259f372f8af9da
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 39b3740da..33afcd574 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -16,7 +16,7 @@ on:
scope:
description: 'Affected component; full for core suites, all for every component'
type: choice
- options: [full, cli, tui, backend, desktop, process, all, companions, website, os, provider, firmware, mobile, daemons]
+ options: [full, cli, tui, backend, desktop, process, all, companions, website, os, provider, firmware, pro, mobile, daemons]
default: full
workflow_call:
inputs:
@@ -62,6 +62,7 @@ jobs:
os: ${{ steps.select.outputs.os }}
provider: ${{ steps.select.outputs.provider }}
firmware: ${{ steps.select.outputs.firmware }}
+ pro: ${{ steps.select.outputs.pro }}
mobile: ${{ steps.select.outputs.mobile }}
daemons: ${{ steps.select.outputs.daemons }}
steps:
@@ -469,6 +470,65 @@ jobs:
python3 devices/harness-pro/firmware/test/test_tree_isolation.py
python3 devices/harness-pro/firmware/test/test_fonts.py
+ pro-firmware-build:
+ concurrency:
+ group: ci-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}-pro-firmware-build
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+ needs: plan
+ if: needs.plan.outputs.ready == 'true' && needs.plan.outputs.pro == 'true'
+ runs-on: ubuntu-24.04
+ timeout-minutes: 20
+ # The ESP-IDF release the Harness Pro is built and flashed with (README: ~/esp/esp-idf-5.5.4).
+ container: espressif/idf:v5.5.4
+ defaults:
+ run:
+ shell: bash
+ working-directory: devices/harness-pro/firmware
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ ref: ${{ env.CI_SOURCE_SHA }}
+ - name: Build the ESP32-P4 firmware
+ run: |
+ . "$IDF_PATH/export.sh" > /dev/null
+ # The font generator needs Pillow; the image's system python3 has no pip, so it goes in the IDF environment.
+ python -m pip install pillow==12.1.1
+ idf.py -B build -DPROJECT_VER=0.0.99-ci build
+ - name: Fit the app in its OTA partition
+ run: |
+ python3 - <<'PY'
+ import csv
+ from pathlib import Path
+ rows = csv.reader(line for line in Path('partitions.csv').read_text().splitlines() if line.strip() and not line.startswith('#'))
+ limit = int(next(row[4] for row in rows if row[0].strip() == 'ota_0').strip(), 0)
+ size = Path('build/harness_pro.bin').stat().st_size
+ print(f'harness_pro.bin: {size} bytes of {limit} in ota_0 ({100 * size / limit:.1f}%)')
+ if size > limit:
+ raise SystemExit('harness_pro.bin does not fit the ota_0 partition')
+ PY
+
+ pro-golden:
+ concurrency:
+ group: ci-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}-pro-golden
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+ needs: plan
+ if: needs.plan.outputs.ready == 'true' && needs.plan.outputs.pro == 'true'
+ # macOS arm64, where the baseline is recorded: the code-drawn shapes (arcs, juggling balls) use float maths whose
+ # last bits differ between Apple arm64 and Linux x86-64, so the hashes only match on the same platform.
+ runs-on: macos-15
+ timeout-minutes: 10
+ steps:
+ - uses: actions/checkout@v7
+ with:
+ ref: ${{ env.CI_SOURCE_SHA }}
+ - name: Compare every Pets screen with the golden hashes
+ working-directory: devices/harness-pro/firmware
+ env:
+ PRO_FONT: fonts/LiberationSans-Regular.ttf
+ run: |
+ python3 -m pip install --user --break-system-packages pillow==12.1.1
+ bash test/golden.sh --check
+
mobile-checks:
concurrency:
group: ci-${{ github.event_name }}-${{ github.event.pull_request.number || github.run_id }}-mobile-checks
@@ -516,7 +576,8 @@ jobs:
required:
name: ci/required
needs: [plan, process-checks, desktop-tests, companion-subsystems, cli-typecheck, cli-tests, tui-test,
- backend-desk, website-checks, os-checks, provider-checks, firmware-checks, mobile-checks, daemons-checks]
+ backend-desk, website-checks, os-checks, provider-checks, firmware-checks, pro-firmware-build, pro-golden,
+ mobile-checks, daemons-checks]
if: always()
runs-on: ubuntu-latest
timeout-minutes: 3
diff --git a/devices/harness-pro/README.md b/devices/harness-pro/README.md
index f2faa061d..5ce1704d9 100644
--- a/devices/harness-pro/README.md
+++ b/devices/harness-pro/README.md
@@ -43,6 +43,9 @@ Golden screens: `firmware/test/golden.sh --check` renders every Pod screen at fi
`test/golden.txt` (or `golden-liberation.txt` when `PRO_FONT` is Liberation). Run it after any change to drawing or
assets; it must match. Rewrite the baseline (`golden.sh` without `--check`) only for an intended visual change.
+PR CI runs these host tests, the golden check (Liberation baseline) and a real ESP-IDF v5.5.4 build that fails
+when `harness_pro.bin` outgrows the `ota_0` partition, for any change under `devices/harness-pro/`.
+
Fonts: the generator uses Helvetica on macOS and the bundled Liberation Sans elsewhere. Tests and CI set
`PRO_FONT=devices/harness-pro/firmware/fonts/LiberationSans-Regular.ttf`. The generated `pro_fonts.c` is a build
artifact: never commit it.
diff --git a/docs/validation-and-release.md b/docs/validation-and-release.md
index bd486b7cb..3cdddf61a 100644
--- a/docs/validation-and-release.md
+++ b/docs/validation-and-release.md
@@ -36,6 +36,7 @@ PR CI is deliberately fast. Each changed component runs only its own Linux suite
| `tui/` | `tui-test` (`cargo test`) | a few minutes |
| `backend/`, `companions/`, `website/`, `os/`, `provider/`, `mobile/`, `daemons/` | that component's one check | 1–4 min |
| `devices/` | `firmware-checks` | 1–2 min |
+| `devices/harness-pro/` | also `pro-firmware-build` (ESP-IDF v5.5.4 build of `harness_pro.bin`, which must fit `ota_0`) and `pro-golden` (`test/golden.sh --check` with Liberation Sans, on macOS arm64 where the baseline is recorded: float maths in the code-drawn shapes differs on Linux x86-64) | build ~4 min, golden ~1 min |
| anything else (docs, workflows, scripts, store) | `process-checks` only | about 1.5 min |
`plan` (actionlint and suite selection), `process-checks` and `ci/required` always
diff --git a/scripts/ci-plan.py b/scripts/ci-plan.py
index 06175a6a3..8b2db3e97 100644
--- a/scripts/ci-plan.py
+++ b/scripts/ci-plan.py
@@ -15,9 +15,10 @@ import subprocess
CORE = {"cli", "desktop", "tui", "backend", "companions"}
EXTRA = {"website", "os", "provider", "firmware", "mobile", "daemons"}
-SUITES = CORE | EXTRA
+SUITES = CORE | EXTRA | {"pro"}
JOBS = {
"cli": {"cli-typecheck", "cli-tests"},
+ "pro": {"pro-firmware-build", "pro-golden"},
"desktop": {"desktop-tests"},
"tui": {"tui-test"}, "backend": {"backend-desk"}, "companions": {"companion-subsystems"},
**{name: {name + "-checks"} for name in EXTRA},
@@ -28,6 +29,8 @@ MANUAL = {"full": CORE, "all": SUITES, "process": set(), **{name: {name} for nam
COMPONENTS = {"cli": "cli", "tests": "cli", "desktop": "desktop", "tui": "tui", "backend": "backend",
"companions": "companions", "website": "website", "os": "os", "provider": "provider",
"devices": "firmware", "mobile": "mobile", "daemons": "daemons"}
+# Narrower directories that add a suite on top of their component's (the ESP32-P4 build and golden screens).
+SUBCOMPONENTS = {"devices/harness-pro/": "pro"}
def git(root, *args):
@@ -47,6 +50,7 @@ def select(paths):
raise ValueError("invalid changed path")
suite = COMPONENTS.get(path.split("/", 1)[0])
scopes = {suite} if suite else set()
+ scopes |= {extra for prefix, extra in SUBCOMPONENTS.items() if path.startswith(prefix)}
selected |= scopes
reasons[path] = sorted(scopes)
return selected, reasons
diff --git a/scripts/tests/test_ci_plan.py b/scripts/tests/test_ci_plan.py
index 98a52f9c5..ff1123c40 100644
--- a/scripts/tests/test_ci_plan.py
+++ b/scripts/tests/test_ci_plan.py
@@ -25,7 +25,8 @@ class SelectionTests(unittest.TestCase):
"backend/src/app.ts": {"backend"}, "companions/src/a.ts": {"companions"},
"website/app/page.tsx": {"website"}, "os/root/usr/lib/session": {"os"},
"provider/spec.md": {"provider"}, "devices/harness-device/firmware/main/main.c": {"firmware"},
- "devices/harness-pro/firmware/main/app/pro_app.c": {"firmware"},
+ "devices/harness-pro/firmware/main/app/pro_app.c": {"firmware", "pro"},
+ "devices/harness-pro/README.md": {"firmware", "pro"}, "devices/harness-pro-other/x.c": {"firmware"},
"mobile/pubspec.lock": {"mobile"}, "daemons/tools/card.mjs": {"daemons"},
}.items():
with self.subTest(path=path):