Skip to content

fix(ci): reuse Bun executable caches without PR writes - #3848

Merged
kev1n77 merged 1 commit into
openBitFun:mainfrom
kev1n77:fmy/bugfix
Nov 9, 2026
Merged

kev1n77 merged 1 commit into
openBitFun:mainfrom
kev1n77:fmy/bugfix

Conversation

@kev1n77

@kev1n77 kev1n77 commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Bun setup currently disables both cache restoration and automatic saving, so jobs without the pinned executable must download it again and can fail before validation starts when the release download returns 504. Restore the pinned Bun executable before setup and save it separately under the existing trust rules, reducing unnecessary downloads while keeping PR runs read-only.

Fixes #3830

Type and Areas

Type: bug fix / CI

Areas: GitHub Actions, Desktop and Linux packaging

Motivation / Impact

  • PRs restore executable caches but never save them. CI pushes to main populate missing entries; reusable Nightly/Linux producers retain their cache_write gate and reject PR events. Desktop release/manual producers may save missing entries.
  • Keep setup-bun automatic caching disabled. It still checks the restored executable and installs the pinned 1.3.14 version on a miss.
  • Share cache keys across the four affected workflows, isolating the Bun version, OS, architecture and Linux x64 AVX2/baseline variant. Cache only the executable, and save it immediately after setup before build commands use it.
  • Older packaging source revisions without the new cache helper emit a notice and retain the original installation path.

No direct product behavior change. Cold-cache downloads can still fail if the upstream download service remains unavailable.

Verification

AI-assisted; targeted local checks completed:

  • pnpm run check:github-config: YAML validation passed; 58 tests passed, 1 skipped because local pwsh is unavailable. New coverage checks platform/version/CPU isolation, actual workflow save conditions, PR write rejection, cache misses/hits, CLI outputs, and older-source compatibility.
  • pnpm run check:repo-hygiene: passed.
  • git diff --check: passed.

Actual GitHub cache restore/save and native runner execution are left to CI. Remote Workspace, Remote Control, Peer Device Mode and Detached Dispatch runtime scenarios were not exercised; this change only affects CI tool preparation.

Reviewer Notes

The original PR cache-write prohibition remains enforced rather than removing no-cache: true. This is download-failure mitigation, not a guarantee against upstream 504s. No cache contents or user data are removed.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable (not applicable to this CI-only change).

@kev1n77
kev1n77 merged commit d3ee3e5 into openBitFun:main Nov 9, 2026
15 checks passed
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.

[Bug]: CI Frontend Build 偶发失败于 setup-bun 下载超时 504(no-cache 误配置导致无法复用 runner 本地工具缓存)

1 participant