Skip to content

ci(desktop-smoke): cache global openclaw install and cargo-installed drivers#84

Merged
webup merged 2 commits into
release/0.3.0from
ci/cache-desktop-smoke-installs
Apr 23, 2026
Merged

ci(desktop-smoke): cache global openclaw install and cargo-installed drivers#84
webup merged 2 commits into
release/0.3.0from
ci/cache-desktop-smoke-installs

Conversation

@webup
Copy link
Copy Markdown
Contributor

@webup webup commented Apr 23, 2026

What

Cache three artifacts that Desktop Smoke previously rebuilt from scratch on every run:

  1. Global `openclaw` CLI install — pin to the version `tests/desktop/harness.mjs` expects (`2026.4.11` today), then `actions/cache@v4` the npm global install dir keyed on `openclaw-cli--`.
  2. `tauri-driver` — swap `cargo install tauri-driver --locked` for `baptiste0928/cargo-install@v3`, which caches the compiled binary keyed on crate+toolchain.
  3. `msedgedriver-tool` (Windows only) — same action. Split the old step in two: cached crate install, then a separate step that runs the tool to download the matching msedgedriver.exe (that download still has to happen per-run because the Edge version on the runner can change).

Why

Windows Desktop Smoke was running 13 minutes per PR and the Windows machine spent all its extra time in three compiles that never varied between runs:

Step Time
`npm install -g openclaw` (native module rebuilds) 6m 12s
`cargo install tauri-driver --locked` 57s
`cargo install msedgedriver-tool` 37s

All three are deterministic given the version pin, so caching is trivially safe. Linux and macOS benefit too — openclaw and tauri-driver caches apply there.

Expected Windows Desktop Smoke on cache hit: ~5m, down from 13m. First run after this merges pays the old cost once to populate the cache.

Behavior changes worth noting

  • CI now installs `openclaw@` instead of `openclaw@latest`. The version comes from `tests/desktop/harness.mjs` (same version the harness bootstraps), so CI + test harness stay aligned. If a future PR bumps the harness version, cache key rotates automatically.
  • If someone wants to override the pin for a one-off run, edit the harness's `openclaw@X.Y.Z` string and push — no workflow edit needed.

Test plan

  • Version-parse command extracts `2026.4.11` correctly from current harness.mjs
  • First CI run on this PR: cache miss on all three, verifies install paths still work (≈ current duration)
  • Second CI run (e.g. force-push an empty commit or open a follow-up PR): cache hit, verifies the time drop and that cached binaries still pass smoke

Target branch

`release/0.3.0` — pure CI optimization, no code changes. Lands first where it's most useful (rc.2 stabilization has several more PRs coming). Forward-propagates to main and develop via standard release merge.

🤖 Generated with Claude Code

webup and others added 2 commits April 23, 2026 17:40
…drivers

Windows Desktop Smoke ran 13m per job — 6m 12s in npm install -g openclaw
(native-module rebuilds), 57s in cargo install tauri-driver, 37s in cargo
install msedgedriver-tool. None were cached across runs.

- Pin openclaw CLI to the version from tests/desktop/harness.mjs (2026.4.11
  today) instead of installing latest, so cache keys are stable and CI uses
  the same version the test harness expects.
- actions/cache@v4 keyed on openclaw-cli-<os>-<version> covers the global
  install directory (lib/node_modules/openclaw + shim scripts). Cache miss
  still installs from registry; subsequent runs skip the install entirely.
- Replace two cargo install ... --locked calls with baptiste0928/cargo-install@v3
  (tauri-driver + msedgedriver-tool). The action caches the compiled binary
  keyed on crate+git+version+toolchain; cache hit copies rather than recompiles.
- Split the msedgedriver-tool step into two: cached crate install, then a
  separate "Materialize Edge WebDriver binary" step that runs the tool to
  download the matching msedgedriver.exe (the download still needs to happen
  per-run since the Edge version on the runner can change).

Expected Windows Desktop Smoke on cache hit: ~5m (down from 13m).
Linux and macOS also benefit from cached openclaw + tauri-driver.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…8 dir

First attempt used baptiste0928/cargo-install@v3, which installs crates into
its own managed cache dir and prepends it to PATH. But tests/desktop/harness.mjs
hardcodes the path ~/.cargo/bin/tauri-driver, so smoke fails after install
even though the binary is on PATH elsewhere.

Revert to plain \`cargo install --locked\` (which installs to ~/.cargo/bin)
and add an actions/cache@v4 keyed on OS that covers both tauri-driver and
msedgedriver-tool binaries. Cache miss falls through to the install; cache
hit skips it entirely.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@webup webup merged commit 16f58a6 into release/0.3.0 Apr 23, 2026
13 checks passed
@webup webup deleted the ci/cache-desktop-smoke-installs branch April 23, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant