From 4ef9c00560f54cec2569ab4bb3b4b16d77bcd72c Mon Sep 17 00:00:00 2001 From: Test Date: Fri, 3 Jul 2026 19:17:21 +0800 Subject: [PATCH] fix(ci): designate a single bun cache saver per OS to stop save races Concurrent Linux/Windows jobs across ci-test.yml, ci-typecheck.yml, and release-fork.yml all computed the same {OS}-bun-{hash} cache key and raced to save it, causing "Unable to reserve cache... another job may be creating this cache" warnings and the cache never actually updating. Now only one job per OS saves (ci-typecheck linux, ci-test e2e windows, release-fork macos); everything else only restores. --- .github/workflows/ci-test.yml | 5 +++++ .github/workflows/release-fork.yml | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 5aaccc1519..26149785da 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -70,6 +70,11 @@ jobs: - name: Setup Bun uses: ./.github/actions/setup-bun + with: + # ci-typecheck.yml's Linux job is the designated Linux cache + # saver (runs on every push, fast, low collision risk) — this job + # only restores, to avoid racing on the same {OS}-bun-{hash} key. + save-cache: false - name: Configure Git Identity run: | diff --git a/.github/workflows/release-fork.yml b/.github/workflows/release-fork.yml index 5e3c59f4ac..50ad2b689e 100644 --- a/.github/workflows/release-fork.yml +++ b/.github/workflows/release-fork.yml @@ -87,6 +87,13 @@ jobs: - name: Setup Bun if: inputs.platforms == '' || contains(inputs.platforms, matrix.name) uses: ./.github/actions/setup-bun + with: + # Linux and Windows bun caches are each owned by a single saver + # elsewhere (ci-typecheck.yml linux, ci-test.yml e2e windows) to + # avoid racing on the same {OS}-bun-{hash} key when this manual + # release build runs concurrently with a push-triggered CI run. + # macOS has no other job in the repo, so it's safe to save here. + save-cache: ${{ matrix.name == 'macos' }} - name: Build CLI if: inputs.platforms == '' || contains(inputs.platforms, matrix.name)