@samitouri / QOS-React / commits / 67338703aa

[ci] Update yarn and node_modules cache key (#32603)

Now that the compiler lint rule is merged into eslint-plugin-react-hooks, we also need to update our caches so compiler dependencies are also cached. This should fix the CI walltime regression we are now seeing. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32603). * #32604 * __->__ #32603

lauren committed Mar 13, 2025 at 20:31 UTC 67338703aa52d662998733e58671dc9fe1edae47
7 files changed +66 -41
.github/workflows/runtime_build_and_test.yml
+52 -28
@@ -50,13 +50,13 @@ jobs:
50 with:
51 node-version-file: '.nvmrc'
52 cache: yarn
53 - cache-dependency-path: yarn.lock
53 + cache-dependency-path: '**/yarn.lock'
54 - name: Restore cached node_modules
55 uses: actions/cache@v4
56 id: node_modules
57 with:
58 path: "**/node_modules"
59 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
59 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
60 - name: Ensure clean build directory
61 run: rm -rf build
62 - run: yarn install --frozen-lockfile
@@ -74,16 +74,18 @@ jobs:
74 with:
75 node-version-file: '.nvmrc'
76 cache: yarn
77 - cache-dependency-path: yarn.lock
77 + cache-dependency-path: '**/yarn.lock'
78 - name: Restore cached node_modules
79 uses: actions/cache@v4
80 id: node_modules
81 with:
82 path: "**/node_modules"
83 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
83 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
84 - name: Ensure clean build directory
85 run: rm -rf build
86 - run: yarn install --frozen-lockfile
87 + - run: yarn install --frozen-lockfile
88 + working-directory: compiler
89 - run: |
90 yarn generate-inline-fizz-runtime
91 git diff --quiet || (echo "There was a change to the Fizz runtime. Run `yarn generate-inline-fizz-runtime` and check in the result." && false)
@@ -100,16 +102,18 @@ jobs:
102 with:
103 node-version-file: '.nvmrc'
104 cache: yarn
103 - cache-dependency-path: yarn.lock
105 + cache-dependency-path: '**/yarn.lock'
106 - name: Restore cached node_modules
107 uses: actions/cache@v4
108 id: node_modules
109 with:
110 path: "**/node_modules"
109 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
111 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
112 - name: Ensure clean build directory
113 run: rm -rf build
114 - run: yarn install --frozen-lockfile
115 + - run: yarn install --frozen-lockfile
116 + working-directory: compiler
117 - run: yarn flags
118
119 # ----- TESTS -----
@@ -153,16 +157,18 @@ jobs:
157 with:
158 node-version-file: '.nvmrc'
159 cache: yarn
156 - cache-dependency-path: yarn.lock
160 + cache-dependency-path: '**/yarn.lock'
161 - name: Restore cached node_modules
162 uses: actions/cache@v4
163 id: node_modules
164 with:
165 path: "**/node_modules"
162 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
166 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
167 - name: Ensure clean build directory
168 run: rm -rf build
169 - run: yarn install --frozen-lockfile
170 + - run: yarn install --frozen-lockfile
171 + working-directory: compiler
172 - run: yarn test ${{ matrix.params }} --ci --shard=${{ matrix.shard }}
173
174 # ----- BUILD -----
@@ -183,7 +189,7 @@ jobs:
189 with:
190 node-version-file: '.nvmrc'
191 cache: yarn
186 - cache-dependency-path: yarn.lock
192 + cache-dependency-path: '**/yarn.lock'
193 - uses: actions/setup-java@v4
194 with:
195 distribution: temurin
@@ -193,10 +199,12 @@ jobs:
199 id: node_modules
200 with:
201 path: "**/node_modules"
196 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
202 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
203 - name: Ensure clean build directory
204 run: rm -rf build
205 - run: yarn install --frozen-lockfile
206 + - run: yarn install --frozen-lockfile
207 + working-directory: compiler
208 - run: yarn build --index=${{ matrix.worker_id }} --total=20 --r=${{ matrix.release_channel }} --ci
209 env:
210 CI: github
@@ -261,16 +269,18 @@ jobs:
269 with:
270 node-version-file: '.nvmrc'
271 cache: yarn
264 - cache-dependency-path: yarn.lock
272 + cache-dependency-path: '**/yarn.lock'
273 - name: Restore cached node_modules
274 uses: actions/cache@v4
275 id: node_modules
276 with:
277 path: "**/node_modules"
270 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
278 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
279 - name: Ensure clean build directory
280 run: rm -rf build
281 - run: yarn install --frozen-lockfile
282 + - run: yarn install --frozen-lockfile
283 + working-directory: compiler
284 - name: Restore archived build
285 uses: actions/download-artifact@v4
286 with:
@@ -293,16 +303,18 @@ jobs:
303 with:
304 node-version-file: '.nvmrc'
305 cache: yarn
296 - cache-dependency-path: yarn.lock
306 + cache-dependency-path: '**/yarn.lock'
307 - name: Restore cached node_modules
308 uses: actions/cache@v4
309 id: node_modules
310 with:
311 path: "**/node_modules"
302 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
312 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
313 - name: Ensure clean build directory
314 run: rm -rf build
315 - run: yarn install --frozen-lockfile
316 + - run: yarn install --frozen-lockfile
317 + working-directory: compiler
318 - name: Restore archived build
319 uses: actions/download-artifact@v4
320 with:
@@ -340,16 +352,18 @@ jobs:
352 with:
353 node-version-file: '.nvmrc'
354 cache: yarn
343 - cache-dependency-path: yarn.lock
355 + cache-dependency-path: '**/yarn.lock'
356 - name: Restore cached node_modules
357 uses: actions/cache@v4
358 id: node_modules
359 with:
360 path: "**/node_modules"
349 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
361 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
362 - name: Ensure clean build directory
363 run: rm -rf build
364 - run: yarn install --frozen-lockfile
365 + - run: yarn install --frozen-lockfile
366 + working-directory: compiler
367 - name: Restore archived build
368 uses: actions/download-artifact@v4
369 with:
@@ -375,16 +389,18 @@ jobs:
389 with:
390 node-version-file: '.nvmrc'
391 cache: yarn
378 - cache-dependency-path: yarn.lock
392 + cache-dependency-path: '**/yarn.lock'
393 - name: Restore cached node_modules
394 uses: actions/cache@v4
395 id: node_modules
396 with:
397 path: "**/node_modules"
384 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
398 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
399 - name: Ensure clean build directory
400 run: rm -rf build
401 - run: yarn install --frozen-lockfile
402 + - run: yarn install --frozen-lockfile
403 + working-directory: compiler
404 - name: Restore archived build
405 uses: actions/download-artifact@v4
406 with:
@@ -407,13 +423,13 @@ jobs:
423 with:
424 node-version-file: '.nvmrc'
425 cache: yarn
410 - cache-dependency-path: yarn.lock
426 + cache-dependency-path: 'fixtures/dom/yarn.lock'
427 - name: Restore cached node_modules
428 uses: actions/cache@v4
429 id: node_modules
430 with:
431 path: "**/node_modules"
416 - key: fixtures_dom-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
432 + key: fixtures_dom-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('fixtures/dom/yarn.lock') }}
433 - name: Ensure clean build directory
434 run: rm -rf build
435 - run: yarn install --frozen-lockfile
@@ -447,7 +463,7 @@ jobs:
463 with:
464 node-version-file: '.nvmrc'
465 cache: yarn
450 - cache-dependency-path: yarn.lock
466 + cache-dependency-path: '**/yarn.lock'
467 # Fixture copies some built packages from the workroot after install.
468 # That means dependencies of the built packages are not installed.
469 # We need to install dependencies of the workroot to fulfill all dependency constraints
@@ -456,10 +472,12 @@ jobs:
472 id: node_modules
473 with:
474 path: "**/node_modules"
459 - key: fixtures_flight-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
475 + key: fixtures_flight-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
476 - name: Ensure clean build directory
477 run: rm -rf build
478 - run: yarn install --frozen-lockfile
479 + - run: yarn install --frozen-lockfile
480 + working-directory: compiler
481 - name: Restore archived build
482 uses: actions/download-artifact@v4
483 with:
@@ -512,16 +530,18 @@ jobs:
530 with:
531 node-version-file: '.nvmrc'
532 cache: yarn
515 - cache-dependency-path: yarn.lock
533 + cache-dependency-path: '**/yarn.lock'
534 - name: Restore cached node_modules
535 uses: actions/cache@v4
536 id: node_modules
537 with:
538 path: "**/node_modules"
521 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
539 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
540 - name: Ensure clean build directory
541 run: rm -rf build
542 - run: yarn install --frozen-lockfile
543 + - run: yarn install --frozen-lockfile
544 + working-directory: compiler
545 - name: Restore archived build
546 uses: actions/download-artifact@v4
547 with:
@@ -563,16 +583,18 @@ jobs:
583 with:
584 node-version-file: '.nvmrc'
585 cache: yarn
566 - cache-dependency-path: yarn.lock
586 + cache-dependency-path: '**/yarn.lock'
587 - name: Restore cached node_modules
588 uses: actions/cache@v4
589 id: node_modules
590 with:
591 path: "**/node_modules"
572 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
592 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
593 - name: Ensure clean build directory
594 run: rm -rf build
595 - run: yarn install --frozen-lockfile
596 + - run: yarn install --frozen-lockfile
597 + working-directory: compiler
598 - name: Restore archived build
599 uses: actions/download-artifact@v4
600 with:
@@ -600,13 +622,13 @@ jobs:
622 with:
623 node-version-file: '.nvmrc'
624 cache: yarn
603 - cache-dependency-path: yarn.lock
625 + cache-dependency-path: '**/yarn.lock'
626 - name: Restore cached node_modules
627 uses: actions/cache@v4
628 id: node_modules
629 with:
630 path: "**/node_modules"
609 - key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
631 + key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
632 - name: Ensure clean build directory
633 run: rm -rf build
634 - run: yarn install --frozen-lockfile
@@ -626,6 +648,8 @@ jobs:
648 - name: Ensure clean build directory
649 run: rm -rf build
650 - run: yarn install --frozen-lockfile
651 + - run: yarn install --frozen-lockfile
652 + working-directory: compiler
653 - name: Restore archived build for PR
654 uses: actions/download-artifact@v4
655 with:
.github/workflows/runtime_eslint_plugin_e2e.yml
+5 -3
@@ -35,16 +35,18 @@ jobs:
35 with:
36 node-version-file: '.nvmrc'
37 cache: yarn
38 - cache-dependency-path: yarn.lock
38 + cache-dependency-path: '**/yarn.lock'
39 - name: Restore cached node_modules
40 uses: actions/cache@v4
41 id: node_modules
42 with:
43 - path: "node_modules"
44 - key: runtime-eslint_e2e-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
43 + path: "**/node_modules"
44 + key: runtime-eslint_e2e-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
45 - name: Ensure clean build directory
46 run: rm -rf build
47 - run: yarn install --frozen-lockfile
48 + - run: yarn install --frozen-lockfile
49 + working-directory: compiler
50 - name: Build plugin
51 working-directory: fixtures/eslint-v${{ matrix.eslint_major }}
52 run: node build.mjs
.github/workflows/runtime_prereleases.yml
+2 -2
@@ -34,13 +34,13 @@ jobs:
34 with:
35 node-version-file: '.nvmrc'
36 cache: yarn
37 - cache-dependency-path: yarn.lock
37 + cache-dependency-path: '**/yarn.lock'
38 - name: Restore cached node_modules
39 uses: actions/cache@v4
40 id: node_modules
41 with:
42 path: "**/node_modules"
43 - key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }}
43 + key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
44 - name: Ensure clean build directory
45 run: rm -rf build
46 - run: yarn install --frozen-lockfile
.github/workflows/runtime_releases_from_npm_manual.yml
+2 -2
@@ -66,13 +66,13 @@ jobs:
66 with:
67 node-version-file: '.nvmrc'
68 cache: yarn
69 - cache-dependency-path: yarn.lock
69 + cache-dependency-path: '**/yarn.lock'
70 - name: Restore cached node_modules
71 uses: actions/cache@v4
72 id: node_modules
73 with:
74 path: "**/node_modules"
75 - key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }}
75 + key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
76 - name: Ensure clean build directory
77 run: rm -rf build
78 - run: yarn install --frozen-lockfile
.github/workflows/shared_lint.yml
+4 -4
@@ -24,7 +24,7 @@ jobs:
24 with:
25 node-version-file: '.nvmrc'
26 cache: yarn
27 - cache-dependency-path: yarn.lock
27 + cache-dependency-path: '**/yarn.lock'
28 - name: Restore cached node_modules
29 uses: actions/cache@v4
30 with:
@@ -44,7 +44,7 @@ jobs:
44 with:
45 node-version-file: '.nvmrc'
46 cache: yarn
47 - cache-dependency-path: yarn.lock
47 + cache-dependency-path: '**/yarn.lock'
48 - name: Restore cached node_modules
49 uses: actions/cache@v4
50 with:
@@ -64,7 +64,7 @@ jobs:
64 with:
65 node-version-file: '.nvmrc'
66 cache: yarn
67 - cache-dependency-path: yarn.lock
67 + cache-dependency-path: '**/yarn.lock'
68 - name: Restore cached node_modules
69 uses: actions/cache@v4
70 with:
@@ -84,7 +84,7 @@ jobs:
84 with:
85 node-version-file: '.nvmrc'
86 cache: yarn
87 - cache-dependency-path: yarn.lock
87 + cache-dependency-path: '**/yarn.lock'
88 - name: Restore cached node_modules
89 uses: actions/cache@v4
90 with:
package.json
+1 -1
@@ -118,7 +118,7 @@
118 "testRegex": "/scripts/jest/dont-run-jest-directly\\.js$"
119 },
120 "scripts": {
121 - "prebuild": "yarn --cwd compiler install --frozen-lockfile && ./scripts/react-compiler/link-compiler.sh",
121 + "prebuild": "./scripts/react-compiler/link-compiler.sh",
122 "build": "node ./scripts/rollup/build-all-release-channels.js",
123 "build-for-devtools": "cross-env RELEASE_CHANNEL=experimental yarn build react/index,react/jsx,react/compiler-runtime,react-dom/index,react-dom/client,react-dom/unstable_testing,react-dom/test-utils,react-is,react-debug-tools,scheduler,react-test-renderer,react-refresh,react-art --type=NODE",
124 "build-for-devtools-dev": "yarn build-for-devtools --type=NODE_DEV",
scripts/react-compiler/build-compiler.sh
-1
@@ -11,5 +11,4 @@ if [[ "$REACT_CLASS_EQUIVALENCE_TEST" == "true" ]]; then
11 fi
12
13 echo "Building babel-plugin-react-compiler..."
14 -yarn --cwd compiler install --frozen-lockfile
14 yarn --cwd compiler workspace babel-plugin-react-compiler build --dts