fix: improve yarn cache strategy to prevent immutable lockfile errors

- Cache .yarn/cache instead of node_modules to avoid inconsistencies
- Include both yarn.lock and package.json in cache key hash
- Update restore-keys to be more specific with package.json hash
- This prevents CI from using stale caches after dependency updates

https://claude.ai/code/session_015R3U3kiprQiNTTNNt31Sg6
This commit is contained in:
Claude
2026-02-14 11:15:18 +00:00
parent 98e4840729
commit 6795522199
+3 -3
View File
@@ -38,11 +38,11 @@ jobs:
id: yarn-cache
with:
path: |
node_modules
.yarn/cache
.yarn/install-state.gz
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock', 'package.json') }}
restore-keys: |
${{ runner.os }}-yarn-
${{ runner.os }}-yarn-${{ hashFiles('package.json') }}-
- name: Install dependencies
env: