Skip to content

ci: optimize cache keys to fix race conditions and reduce usage#8578

Merged
Boshen merged 4 commits intomainfrom
ci/cache-optimization
Mar 8, 2026
Merged

ci: optimize cache keys to fix race conditions and reduce usage#8578
Boshen merged 4 commits intomainfrom
ci/cache-optimization

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Mar 7, 2026

Summary

  • Delete cache-warmup.yml — was warming caches across all 3 OS unnecessarily, wasting ~3 GB of cache space
  • Assign unique cache keys per job type instead of sharing debug-build across all jobs, which caused race conditions where the first job to finish saved a partial cache:
    • rust-validationlint (ubuntu only)
    • cargo-testcargo-test (3 OS)
    • reusable-native-build / node-validation / vite-testsnative-build (3 OS)
    • reusable-wasi-buildwasi-build (ubuntu only)
  • Add save-cache guards — only save cache on main branch pushes
  • Disable release build caching — set restore-cache: false on reusable-release-build.yml (including build-rolldown-browser and build-rolldown-debug) to prevent cache poisoning in published artifacts
  • Skip cache restore and save for metric.yml — it does cargo clean immediately, so restoring/saving is wasted I/O and could collide with benchmark-node.yml's release-build cache

Estimated total cache usage drops from ~9.9 GB to ~6.4 GB, well within the 10 GB limit.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings March 7, 2026 15:43
@netlify
Copy link

netlify bot commented Mar 7, 2026

Deploy Preview for rolldown-rs canceled.

Name Link
🔨 Latest commit aeedd63
🔍 Latest deploy log https://app.netlify.com/projects/rolldown-rs/deploys/69acf0bb84850500088b8aa0

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes GitHub Actions cache usage by replacing the shared debug-build cache key with per-job-type keys, adding save-cache guards to only save on main branch pushes, disabling caching for release and metric builds, and removing the now-unnecessary cache-warmup.yml workflow.

Changes:

  • Assign unique cache keys per job type (lint, cargo-test, native-build, wasi-build) instead of sharing a single debug-build key, and add save-cache guards to limit saves to main branch pushes only.
  • Disable cache restore/save for release builds (reusable-release-build.yml) and metric builds (metric.yml) to prevent cache poisoning and wasted I/O.
  • Delete cache-warmup.yml which was warming caches across all 3 OS unnecessarily.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.github/workflows/ci.yml Update rust-validation to lint key and node-validation to native-build key; add save-cache guards
.github/workflows/reusable-cargo-test.yml Change cache key from debug-build to cargo-test; add save-cache guard
.github/workflows/reusable-native-build.yml Change cache key from debug-build to native-build; add save-cache guard
.github/workflows/reusable-wasi-build.yml Change cache key from debug-build-wasi to wasi-build; add save-cache guard
.github/workflows/vite-tests.yml Change cache key from debug-build to native-build; add save-cache guard
.github/workflows/reusable-release-build.yml Replace per-target cache keys with restore-cache: false for build-binding and build-rolldown-browser
.github/workflows/metric.yml Add restore-cache: false since cargo clean immediately follows
.github/workflows/cache-warmup.yml Deleted; cache warming is now handled by save-cache guards on individual jobs

Copilot AI review requested due to automatic review settings March 7, 2026 16:13
@Boshen Boshen force-pushed the ci/cache-optimization branch from f13419b to 0c24c8d Compare March 7, 2026 16:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.

@Boshen Boshen force-pushed the ci/cache-optimization branch 2 times, most recently from bda460c to 929465e Compare March 7, 2026 16:27
Copilot AI review requested due to automatic review settings March 7, 2026 16:27
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3a3088f1d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copilot AI review requested due to automatic review settings March 8, 2026 03:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

Boshen and others added 4 commits March 8, 2026 11:44
Assign correct cache keys per job type instead of sharing `debug-build`
across all jobs, which caused race conditions where the first job to
finish saved a partial cache. Remove the `cache-warmup.yml` workflow
that wasted space on unused OS/target combinations. Disable caching
for release builds to prevent cache poisoning. Skip cache restore for
metric job since it does `cargo clean` immediately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- metric.yml: remove `cache-key` (dead with `restore-cache: false`),
  add `save-cache: false` to prevent unnecessary cache writes that
  could collide with benchmark-node.yml
- reusable-release-build.yml: change build-rolldown-debug from
  `cache-key: debug-build` to `restore-cache: false` for consistency
  with sibling release build jobs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- reusable-release-build.yml: add explicit `save-cache: false` alongside
  `restore-cache: false` to fully disable caching for release builds
- copilot-setup-steps.yml: update orphaned `debug-build` key to `lint`
- update-test-dependencies.yml: update orphaned `debug-build` key to
  `native-build` and add `save-cache: false`

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
metric.yml does `cargo build --release` so it shouldn't share the
`release-build` key with benchmark-node.yml. Give it a dedicated
`metric` key and allow saving (on main only, via setup-rust default).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Boshen Boshen force-pushed the ci/cache-optimization branch from 0a64abb to aeedd63 Compare March 8, 2026 03:44
@Boshen Boshen merged commit 8ace1b8 into main Mar 8, 2026
35 checks passed
@Boshen Boshen deleted the ci/cache-optimization branch March 8, 2026 03:56
@Boshen Boshen mentioned this pull request Mar 8, 2026
@github-actions github-actions bot mentioned this pull request Mar 9, 2026
shulaoda added a commit that referenced this pull request Mar 9, 2026
## [1.0.0-rc.8] - 2026-03-09

### 🚀 Features

- watch: enable full functional fs watcher in wasm (#8575) by @hyf0
- watch: expose debounce related options (#8572) by @hyf0

### 🐛 Bug Fixes

- detect new URL(…, import.meta.url) with no-sub template literal (#8565) by @char
- devtools: trace dynamic imports in devtools (#8581) by @cal-gooo
- watch: rebuild when a previously missing file is created (#8562) by @hyf0-agent
- watch: filter out Access events to prevent infinite rebuild loop on Linux (#8557) by @hyf0-agent

### 🚜 Refactor

- watch: remove auto watch for fail imports (#8585) by @hyf0
- fs_watcher: unify the way of constructing watcher (#8571) by @hyf0
- cli: migrate CLI to CAC (#8551) by @h-a-n-a
- switch asset module support from hard-code to builtin plugin (#8546) by @hyf0

### 📚 Documentation

- fix subject-verb agreement in why-bundlers.md (#8591) by @brandonzylstra
- maintenance: align release and canary workflow guide (#8538) by @minsoo-web
- add `format` option to directives example config (#8590) by @shulaoda
- fix: change twitter to x logo in team (#8552) by @mdong1909
- correct composable filter support explanation (#8550) by @sapphi-red

### ⚡ Performance

- testing: share tokio runtime across fixture tests (#8567) by @Boshen

### 🧪 Testing

- hmr: fix infinite loop in dev server test retry logic (#8576) by @hyf0-agent
- cli: add more cli-e2e test cases (#8548) by @h-a-n-a

### ⚙️ Miscellaneous Tasks

- docs: update in-depth/directives for `output.strict` option (#8535) by @minsoo-web
- add PNPM_HOME Dev Drive mapping to Windows CI workflows (#8589) by @Boshen
- deps: update github-actions (#8588) by @renovate[bot]
- move Windows cargo target dir to Dev Drive (#8586) by @Boshen
- optimize cache keys to fix race conditions and reduce usage (#8578) by @Boshen
- remove WASI build & test pipeline (#8580) by @Boshen
- remove unnecessary submodule checkouts (#8577) by @Boshen
- use Dev Drive for Windows CI jobs (#8574) by @Boshen
- skip redundant native binding build for browser and remove standalone job (#8573) by @Boshen
- parallelize Node tests on ubuntu, single Node 24 on macOS/windows (#8570) by @Boshen
- docs: bump @voidzero-dev/vitepress-theme to 4.8.0 (#8558) by @crusty-voidzero
- dedupe type-check from dev server workflow (#8554) by @Boshen

### ❤️ New Contributors

* @brandonzylstra made their first contribution in [#8591](#8591)
* @char made their first contribution in [#8565](#8565)
* @cal-gooo made their first contribution in [#8581](#8581)
* @hyf0-agent made their first contribution in [#8562](#8562)
* @h-a-n-a made their first contribution in [#8551](#8551)

Co-authored-by: shulaoda <165626830+shulaoda@users.noreply.github.com>
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.

3 participants