Skip to content

ci(workflow): use internal cache on self-hosted runners - #2913

Open
quanruzhuoxiu wants to merge 15 commits into
mainfrom
ci/use-internal-tos-cache
Open

ci(workflow): use internal cache on self-hosted runners#2913
quanruzhuoxiu wants to merge 15 commits into
mainfrom
ci/use-internal-tos-cache

Conversation

@quanruzhuoxiu

@quanruzhuoxiu quanruzhuoxiu commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • route eligible Linux, macOS, and Windows jobs through repository runner variables, while retaining GitHub-hosted runners where KVM or interactive desktop constraints require them
  • route cache operations to GitHub storage on hosted runners and the internal TOS cache service on self-hosted runners, following the web-infra-dev/rspack pattern
  • cache the Node toolcache, pnpm store, Playwright dependencies, Puppeteer Chrome for Testing, and Electron artifacts
  • replace repeated full browser/system setup with reusable setup actions and install only missing runtime dependencies
  • use focused Nx builds, shallow checkouts where history is unnecessary, docs-only path filters, and cheaper trigger conditions
  • remove duplicated report and extension AI scenarios while preserving dedicated AI coverage
  • limit model-heavy platform jobs to one mobile lane and one desktop lane, and split Headless extension jobs into dependency chains so queued work does not occupy runners or exceed the shared model TPM quota
  • make report validation select a successful Playwright retry instead of a failed first attempt when the suite ultimately passed

Timing results

All runner durations exclude queue time.

Job Before Cold cache Hot cache
Chrome Extension 36:54 7:05 5:03
Bridge 17:42 9:57 8:01
Playground 19:18 14:13 12:56
Recorder 11:38 9:09 10:17
Settings 19:03 14:23 12:10
AI Todo 15:03 8:14 11:22
AI e2e-web 26:31 13:25 10:47
AI e2e-report 20:36 14:32 16:04
AI unit 16:04 13:49 11:18

Final validation on 7474a3c8d after model-quota scheduling:

Job Actual runner time End-to-end Result
e2e-web 13:43 14:33 passed
e2e-report 10:46 11:36 passed
AI unit 15:50 16:39 passed
iOS 6:32 7:02 passed
Android 10:36 17:48 passed after iOS lane
macOS 14:15 14:20 passed
Windows 8:14 22:39 passed after macOS lane
Chrome Extension 5:32 7:29 passed
Recorder 11:35 12:36 passed
Settings 10:57 26:40 passed after Recorder
Bridge 11:08 22:10 passed after Chrome Extension
Playground 31:05 53:40 passed after Bridge

The serialized lanes intentionally trade some end-to-end latency for lower concurrent runner usage and model stability. In the unthrottled run, iOS, macOS, and Recorder all failed after three 429 ModelAccountTpmRateLimitExceeded responses. The throttled run completed 16/16 checks without a TPM failure. Playground remains the wall-clock bottleneck and its 31:05 runner time is model variance rather than queue time.

The e2e-web browser setup itself dropped from 4:06 to 0:23. A separate run had a 4:59 checkout outlier, so checkout, setup, and AI-test variance are reported separately rather than attributed to runner performance.

Validation

  • pnpm run lint
  • YAML parsing for all changed workflows and report scenarios
  • pnpm exec nx run-many --target=build --projects="@midscene/report,@midscene/core,@midscene/web,@midscene/cli" --skip-nx-cache
  • pnpm exec nx run-many --target=build --projects="@midscene/report,chrome-extension" --skip-nx-cache
  • pnpm exec nx run-many --target=build --projects="@midscene/report,@midscene/computer" --skip-nx-cache
  • pnpm exec nx test @midscene/report (15 files, 82 tests)
  • NODE_OPTIONS=--max-old-space-size=8192 pnpm --dir packages/computer exec vitest run tests/unit-test (13 files, 88 tests)
  • pnpm --dir packages/core exec vitest run tests/unit-test/yaml-player-output.test.ts
  • validated report retry selection against the failed run's real merged HTML artifact
  • git diff --check
  • final GitHub Actions run: 16/16 checks passed

@quanruzhuoxiu
quanruzhuoxiu force-pushed the ci/use-internal-tos-cache branch from 4aacbcd to 8658a7d Compare July 31, 2026 04:00
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