[ci] Warm cache (#32685)
Try restoring from old caches as a base to speed up the case where node_modules needs updating. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32685). * #32686 * __->__ #32685
lauren committed
Mar 20, 2025 at 12:21 UTC
3bcf8c23debf0c0c746ed11801fa1fe64dfb0159
1 file changed
+20
.github/workflows/runtime_build_and_test.yml
+20
@@ -41,6 +41,16 @@ jobs:
41
node-version-file: '.nvmrc'
42
cache: yarn
43
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-
54
- run: yarn install --frozen-lockfile
55
if: steps.node_modules.outputs.cache-hit != 'true'
56
- name: Save cache
@@ -74,6 +84,16 @@ jobs:
84
cache-dependency-path: |
85
yarn.lock
86
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-
97
- run: yarn install --frozen-lockfile
98
if: steps.node_modules.outputs.cache-hit != 'true'
99
- run: yarn --cwd compiler install --frozen-lockfile