chore: remove node_modules from actions cache (#7820)

**Motivation**

- looking at our actions cache usage, trying to improve usage of the
10GB total capacity

**Description**

- It looks like we were caching both:
  - yarn global cache
  - node_modules

- Remove node_modules from the cache since the yarn global cache should
suffice

---------

Co-authored-by: Nazar Hussain <nazarhussain@gmail.com>
Co-authored-by: Nico Flaig <nflaig@protonmail.com>
This commit is contained in:
Cayman
2025-05-23 08:05:49 -04:00
committed by GitHub
parent 2b54941538
commit 7a77881728

View File

@@ -13,6 +13,8 @@ runs:
with:
node-version: ${{inputs.node}}
check-latest: true
# The hash of yarn.lock file will be used as cache key
# So unless our dependencies change, we can reuse the cache
cache: yarn
- name: Node.js version
@@ -20,28 +22,26 @@ runs:
shell: bash
run: echo "v8CppApiVersion=$(node --print "process.versions.modules")" >> $GITHUB_OUTPUT
- name: Create cache key
id: build-cache
shell: bash
# This build cache will be reused among different jobs for the same commit
run: echo "key=build-cache-${{ runner.os }}-${{ runner.arch }}-node-${{ inputs.node }}-${{ github.sha }}" >> $GITHUB_OUTPUT
- name: Restore build
uses: actions/cache/restore@v4
id: cache-build-restore
with:
path: |
node_modules
packages/*/node_modules
lib/
packages/*/lib
packages/*/.git-data.json
key: ${{ runner.os }}-${{ runner.arch }}-node-${{ inputs.node }}-${{ github.sha }}
key: ${{ steps.build-cache.outputs.key }}
- name: Install & build
if: steps.cache-build-restore.outputs.cache-hit != 'true'
shell: bash
run: yarn install --frozen-lockfile && yarn build
- name: Build
if: steps.cache-build-restore.outputs.cache-hit == 'true'
shell: bash
run: yarn build
- name: Check Build
shell: bash
run: yarn check-build
@@ -58,9 +58,7 @@ runs:
uses: actions/cache@v4
with:
path: |
node_modules
packages/*/node_modules
lib/
packages/*/lib
packages/*/.git-data.json
key: ${{ runner.os }}-${{ runner.arch }}-node-${{ inputs.node }}-${{ github.sha }}
key: ${{ steps.build-cache.outputs.key }}