Skip to content

ci: cancel superseded runs, cache bun downloads and transform output, bound matrix cells#72

Open
danfry1 wants to merge 1 commit into
mainfrom
ci/hygiene
Open

ci: cancel superseded runs, cache bun downloads and transform output, bound matrix cells#72
danfry1 wants to merge 1 commit into
mainfrom
ci/hygiene

Conversation

@danfry1

@danfry1 danfry1 commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Problem

Four CI-hygiene gaps:

  1. No concurrency control. A force-push to a PR branch left the superseded run — 5 full-gate legs plus 12 matrix cells — executing to completion alongside the new run.
  2. No dependency caching. Every job cold-downloaded all packages on every run.
  3. The native engine's transform work was rebuilt from scratch every job. Each matrix cell Babel-transforms React Native's ~250-file boot graph; nothing persisted it.
  4. Matrix cells had no timeout — a hung cell (e.g. a stuck hot-soak worker) burned the 360-minute default.

Change

  • concurrency groups on ci.yml and native-rn-matrix.yml with cancel-in-progress on non-main refs; pushes to main stay uncancelled so every landed commit gets a full verdict.
  • actions/cache (SHA-pinned, v4.3.0) for bun's package-download store, keyed on the lockfile. Installs still verify with --frozen-lockfile; only the tarball downloads are skipped.
  • actions/cache for packages/vitest-native/node_modules/.cache/vitest-native (the Babel transform + V8 compile caches), keyed per OS/Node leg in the full gate and per RN × Vitest cell in the matrix. The cache's entries are content- and version-keyed internally, so a stale restore can only miss, never serve a wrong hit. This step becomes effective once the transform-cache relocation (perf/transform-cache) lands — before that the path doesn't exist and the step is a harmless no-op, so the two PRs can land in either order.
  • timeout-minutes: 30 on the matrix job (healthy cells finish well under 15).

All new expressions use trusted contexts only (github.ref, runner.os, matrix.*, hashFiles); no event-payload data reaches run: commands.

… bound matrix cells

- Add concurrency groups to ci.yml and native-rn-matrix.yml: a force-push to
  a PR branch previously left the superseded run (5 gate legs + 12 matrix
  cells) executing to completion alongside the new one. Main pushes stay
  uncancelled so every landed commit gets a full verdict.
- Cache bun's package-download store keyed on the lockfile; installs still
  verify against --frozen-lockfile, they just skip re-downloading tarballs.
- Persist vitest-native's own on-disk caches (Babel transform of the RN
  graph + V8 compile cache) across runs, keyed per OS/Node leg and per
  RN × Vitest matrix cell. The entries are content/version-keyed internally,
  so a stale restore is a miss, never a wrong hit. (Effective once the cache
  moves under node_modules/.cache — see the transform-cache change; the step
  is a no-op before that.)
- Bound matrix cells with timeout-minutes: 30 — a hung cell previously
  burned the 360-minute default; healthy cells finish well under 15.
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