Skip to content

Commit 51e5e74

Browse files
committed
[ci] Warm cache
Try restoring from old caches as a base to speed up the case where node_modules needs updating.
1 parent a4f9bd5 commit 51e5e74

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/runtime_build_and_test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ jobs:
4141
node-version-file: '.nvmrc'
4242
cache: yarn
4343
cache-dependency-path: yarn.lock
44+
- name: Warm with old cache
45+
if: steps.node_modules.outputs.cache-hit != 'true'
46+
uses: actions/cache/restore@v4
47+
with:
48+
path: |
49+
**/node_modules
50+
key: runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
51+
restore-keys: |
52+
runtime-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
53+
runtime-node_modules-v6-
4454
- run: yarn install --frozen-lockfile
4555
if: steps.node_modules.outputs.cache-hit != 'true'
4656
- name: Save cache
@@ -74,6 +84,16 @@ jobs:
7484
cache-dependency-path: |
7585
yarn.lock
7686
compiler/yarn.lock
87+
- name: Warm with old cache
88+
if: steps.node_modules.outputs.cache-hit != 'true'
89+
uses: actions/cache/restore@v4
90+
with:
91+
path: |
92+
**/node_modules
93+
key: runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'compiler/yarn.lock') }}
94+
restore-keys: |
95+
runtime-and-compiler-node_modules-v6-${{ runner.arch }}-${{ runner.os }}-
96+
runtime-and-compiler-node_modules-v6-
7797
- run: yarn install --frozen-lockfile
7898
if: steps.node_modules.outputs.cache-hit != 'true'
7999
- run: yarn --cwd compiler install --frozen-lockfile

0 commit comments

Comments
 (0)