From 1b3ca82a8408c25ab3b7911c64483fc87a3bdbb6 Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Mon, 20 Apr 2026 13:23:42 -0400 Subject: [PATCH] fix(ci): stop caching node_modules in GitHub Actions - cache only Bun's package cache so CI stops restoring partial hard-linked node_modules trees - bump the cache key to avoid reusing corrupt node_modules archives on self-hosted runners --- .github/workflows/ci.yml | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86529a56..eb7f95c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,16 +40,14 @@ jobs: with: node-version: '22' - - name: Restore bun + node_modules cache + - name: Restore bun package cache uses: actions/cache@v4 with: path: | ~/.bun/install/cache - node_modules - ui/node_modules - key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'ui/bun.lock') }} + key: ${{ runner.os }}-bun-cache-v2-${{ hashFiles('bun.lock', 'ui/bun.lock') }} restore-keys: | - ${{ runner.os }}-bun- + ${{ runner.os }}-bun-cache-v2- - name: Ensure dependencies run: bash scripts/ensure-deps.sh @@ -74,16 +72,14 @@ jobs: with: node-version: '22' - - name: Restore bun + node_modules cache + - name: Restore bun package cache uses: actions/cache@v4 with: path: | ~/.bun/install/cache - node_modules - ui/node_modules - key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'ui/bun.lock') }} + key: ${{ runner.os }}-bun-cache-v2-${{ hashFiles('bun.lock', 'ui/bun.lock') }} restore-keys: | - ${{ runner.os }}-bun- + ${{ runner.os }}-bun-cache-v2- - name: Ensure dependencies run: bash scripts/ensure-deps.sh @@ -117,16 +113,14 @@ jobs: with: node-version: '22' - - name: Restore bun + node_modules cache + - name: Restore bun package cache uses: actions/cache@v4 with: path: | ~/.bun/install/cache - node_modules - ui/node_modules - key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock', 'ui/bun.lock') }} + key: ${{ runner.os }}-bun-cache-v2-${{ hashFiles('bun.lock', 'ui/bun.lock') }} restore-keys: | - ${{ runner.os }}-bun- + ${{ runner.os }}-bun-cache-v2- - name: Ensure dependencies run: bash scripts/ensure-deps.sh