From 76b5ee2296b9b3ebc8178194bf244a4337013bd5 Mon Sep 17 00:00:00 2001 From: Yuhan Lei Date: Mon, 20 Apr 2026 22:55:38 +0800 Subject: [PATCH 1/2] ci: fix turbo cache path to .turbo/cache The `actions/cache` step pointed at `node_modules/.cache/turbo`, which is turbo v1's default. Turbo v2 writes to `.turbo/cache`, so the cache path bound to an empty directory: the post-action save silently wrote nothing, no `turbo-Linux-*` key ever landed in the pool, and every run three-way-missed the restore keys (observed on PR #72 logs). Net effect: seven tasks marked `cache miss, executing` on every PR unit job, turning a YAML-only PR into a full 232s cold run. Refs: #74 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7682f22a..3cc137bf8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5 with: - path: node_modules/.cache/turbo + path: .turbo/cache key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json', 'bun.lock') }}-${{ github.sha }} restore-keys: | turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json', 'bun.lock') }}- @@ -154,7 +154,7 @@ jobs: - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5 with: - path: node_modules/.cache/turbo + path: .turbo/cache key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json', 'bun.lock') }}-${{ github.sha }} restore-keys: | turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json', 'bun.lock') }}- From 361c0bf655708ca20732d1697ee5f946bcdeb6a0 Mon Sep 17 00:00:00 2001 From: Yuhan Lei Date: Mon, 20 Apr 2026 23:09:39 +0800 Subject: [PATCH 2/2] ci: split turbo cache key per job to avoid save race typecheck and unit jobs shared the exact same cache key (turbo-Linux--). With path now pointing at the real turbo v2 cache dir, they would race on reserveCache: typecheck finishes first (~60s) and wins the reservation, unit (~232s) hits ReserveCacheError and skips upload. Effect: pool accumulates only typecheck-flavored tarballs. Next run's unit job restores typecheck's cache, finds no matching test:ci task hash, and re-executes the full 232s suite. Split the key with a job discriminator (-typecheck / -unit) so each job saves and restores its own slice. Refs: #74 --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cc137bf8..421ad03ef 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,10 +114,10 @@ jobs: - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5 with: path: .turbo/cache - key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json', 'bun.lock') }}-${{ github.sha }} + key: turbo-${{ runner.os }}-typecheck-${{ hashFiles('turbo.json', '**/package.json', 'bun.lock') }}-${{ github.sha }} restore-keys: | - turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json', 'bun.lock') }}- - turbo-${{ runner.os }}- + turbo-${{ runner.os }}-typecheck-${{ hashFiles('turbo.json', '**/package.json', 'bun.lock') }}- + turbo-${{ runner.os }}-typecheck- - run: bun install --frozen-lockfile @@ -155,10 +155,10 @@ jobs: - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # actions/cache@v5 with: path: .turbo/cache - key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json', 'bun.lock') }}-${{ github.sha }} + key: turbo-${{ runner.os }}-unit-${{ hashFiles('turbo.json', '**/package.json', 'bun.lock') }}-${{ github.sha }} restore-keys: | - turbo-${{ runner.os }}-${{ hashFiles('turbo.json', '**/package.json', 'bun.lock') }}- - turbo-${{ runner.os }}- + turbo-${{ runner.os }}-unit-${{ hashFiles('turbo.json', '**/package.json', 'bun.lock') }}- + turbo-${{ runner.os }}-unit- - run: bun install --frozen-lockfile