Skip to content

Commit 5200721

Browse files
authored
Revert "[ci] Update yarn and node_modules cache key (facebook#32603)" (facebook#32607)
This reverts commit 6733870. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32607). * facebook#32609 * facebook#32608 * __->__ facebook#32607
1 parent e9d80d9 commit 5200721

File tree

7 files changed

+41
-66
lines changed

7 files changed

+41
-66
lines changed

.github/workflows/runtime_build_and_test.yml

Lines changed: 28 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ jobs:
5050
with:
5151
node-version-file: '.nvmrc'
5252
cache: yarn
53-
cache-dependency-path: '**/yarn.lock'
53+
cache-dependency-path: yarn.lock
5454
- name: Restore cached node_modules
5555
uses: actions/cache@v4
5656
id: node_modules
5757
with:
5858
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') }}
6060
- name: Ensure clean build directory
6161
run: rm -rf build
6262
- run: yarn install --frozen-lockfile
@@ -74,18 +74,16 @@ jobs:
7474
with:
7575
node-version-file: '.nvmrc'
7676
cache: yarn
77-
cache-dependency-path: '**/yarn.lock'
77+
cache-dependency-path: yarn.lock
7878
- name: Restore cached node_modules
7979
uses: actions/cache@v4
8080
id: node_modules
8181
with:
8282
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') }}
8484
- name: Ensure clean build directory
8585
run: rm -rf build
8686
- run: yarn install --frozen-lockfile
87-
- run: yarn install --frozen-lockfile
88-
working-directory: compiler
8987
- run: |
9088
yarn generate-inline-fizz-runtime
9189
git diff --quiet || (echo "There was a change to the Fizz runtime. Run `yarn generate-inline-fizz-runtime` and check in the result." && false)
@@ -102,18 +100,16 @@ jobs:
102100
with:
103101
node-version-file: '.nvmrc'
104102
cache: yarn
105-
cache-dependency-path: '**/yarn.lock'
103+
cache-dependency-path: yarn.lock
106104
- name: Restore cached node_modules
107105
uses: actions/cache@v4
108106
id: node_modules
109107
with:
110108
path: "**/node_modules"
111-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
109+
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
112110
- name: Ensure clean build directory
113111
run: rm -rf build
114112
- run: yarn install --frozen-lockfile
115-
- run: yarn install --frozen-lockfile
116-
working-directory: compiler
117113
- run: yarn flags
118114

119115
# ----- TESTS -----
@@ -157,18 +153,16 @@ jobs:
157153
with:
158154
node-version-file: '.nvmrc'
159155
cache: yarn
160-
cache-dependency-path: '**/yarn.lock'
156+
cache-dependency-path: yarn.lock
161157
- name: Restore cached node_modules
162158
uses: actions/cache@v4
163159
id: node_modules
164160
with:
165161
path: "**/node_modules"
166-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
162+
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
167163
- name: Ensure clean build directory
168164
run: rm -rf build
169165
- run: yarn install --frozen-lockfile
170-
- run: yarn install --frozen-lockfile
171-
working-directory: compiler
172166
- run: yarn test ${{ matrix.params }} --ci --shard=${{ matrix.shard }}
173167

174168
# ----- BUILD -----
@@ -189,7 +183,7 @@ jobs:
189183
with:
190184
node-version-file: '.nvmrc'
191185
cache: yarn
192-
cache-dependency-path: '**/yarn.lock'
186+
cache-dependency-path: yarn.lock
193187
- uses: actions/setup-java@v4
194188
with:
195189
distribution: temurin
@@ -199,12 +193,10 @@ jobs:
199193
id: node_modules
200194
with:
201195
path: "**/node_modules"
202-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
196+
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
203197
- name: Ensure clean build directory
204198
run: rm -rf build
205199
- run: yarn install --frozen-lockfile
206-
- run: yarn install --frozen-lockfile
207-
working-directory: compiler
208200
- run: yarn build --index=${{ matrix.worker_id }} --total=20 --r=${{ matrix.release_channel }} --ci
209201
env:
210202
CI: github
@@ -269,18 +261,16 @@ jobs:
269261
with:
270262
node-version-file: '.nvmrc'
271263
cache: yarn
272-
cache-dependency-path: '**/yarn.lock'
264+
cache-dependency-path: yarn.lock
273265
- name: Restore cached node_modules
274266
uses: actions/cache@v4
275267
id: node_modules
276268
with:
277269
path: "**/node_modules"
278-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
270+
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
279271
- name: Ensure clean build directory
280272
run: rm -rf build
281273
- run: yarn install --frozen-lockfile
282-
- run: yarn install --frozen-lockfile
283-
working-directory: compiler
284274
- name: Restore archived build
285275
uses: actions/download-artifact@v4
286276
with:
@@ -303,18 +293,16 @@ jobs:
303293
with:
304294
node-version-file: '.nvmrc'
305295
cache: yarn
306-
cache-dependency-path: '**/yarn.lock'
296+
cache-dependency-path: yarn.lock
307297
- name: Restore cached node_modules
308298
uses: actions/cache@v4
309299
id: node_modules
310300
with:
311301
path: "**/node_modules"
312-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
302+
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
313303
- name: Ensure clean build directory
314304
run: rm -rf build
315305
- run: yarn install --frozen-lockfile
316-
- run: yarn install --frozen-lockfile
317-
working-directory: compiler
318306
- name: Restore archived build
319307
uses: actions/download-artifact@v4
320308
with:
@@ -352,18 +340,16 @@ jobs:
352340
with:
353341
node-version-file: '.nvmrc'
354342
cache: yarn
355-
cache-dependency-path: '**/yarn.lock'
343+
cache-dependency-path: yarn.lock
356344
- name: Restore cached node_modules
357345
uses: actions/cache@v4
358346
id: node_modules
359347
with:
360348
path: "**/node_modules"
361-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
349+
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
362350
- name: Ensure clean build directory
363351
run: rm -rf build
364352
- run: yarn install --frozen-lockfile
365-
- run: yarn install --frozen-lockfile
366-
working-directory: compiler
367353
- name: Restore archived build
368354
uses: actions/download-artifact@v4
369355
with:
@@ -389,18 +375,16 @@ jobs:
389375
with:
390376
node-version-file: '.nvmrc'
391377
cache: yarn
392-
cache-dependency-path: '**/yarn.lock'
378+
cache-dependency-path: yarn.lock
393379
- name: Restore cached node_modules
394380
uses: actions/cache@v4
395381
id: node_modules
396382
with:
397383
path: "**/node_modules"
398-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
384+
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
399385
- name: Ensure clean build directory
400386
run: rm -rf build
401387
- run: yarn install --frozen-lockfile
402-
- run: yarn install --frozen-lockfile
403-
working-directory: compiler
404388
- name: Restore archived build
405389
uses: actions/download-artifact@v4
406390
with:
@@ -423,13 +407,13 @@ jobs:
423407
with:
424408
node-version-file: '.nvmrc'
425409
cache: yarn
426-
cache-dependency-path: 'fixtures/dom/yarn.lock'
410+
cache-dependency-path: yarn.lock
427411
- name: Restore cached node_modules
428412
uses: actions/cache@v4
429413
id: node_modules
430414
with:
431415
path: "**/node_modules"
432-
key: fixtures_dom-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('fixtures/dom/yarn.lock') }}
416+
key: fixtures_dom-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
433417
- name: Ensure clean build directory
434418
run: rm -rf build
435419
- run: yarn install --frozen-lockfile
@@ -463,7 +447,7 @@ jobs:
463447
with:
464448
node-version-file: '.nvmrc'
465449
cache: yarn
466-
cache-dependency-path: '**/yarn.lock'
450+
cache-dependency-path: yarn.lock
467451
# Fixture copies some built packages from the workroot after install.
468452
# That means dependencies of the built packages are not installed.
469453
# We need to install dependencies of the workroot to fulfill all dependency constraints
@@ -472,12 +456,10 @@ jobs:
472456
id: node_modules
473457
with:
474458
path: "**/node_modules"
475-
key: fixtures_flight-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
459+
key: fixtures_flight-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
476460
- name: Ensure clean build directory
477461
run: rm -rf build
478462
- run: yarn install --frozen-lockfile
479-
- run: yarn install --frozen-lockfile
480-
working-directory: compiler
481463
- name: Restore archived build
482464
uses: actions/download-artifact@v4
483465
with:
@@ -530,18 +512,16 @@ jobs:
530512
with:
531513
node-version-file: '.nvmrc'
532514
cache: yarn
533-
cache-dependency-path: '**/yarn.lock'
515+
cache-dependency-path: yarn.lock
534516
- name: Restore cached node_modules
535517
uses: actions/cache@v4
536518
id: node_modules
537519
with:
538520
path: "**/node_modules"
539-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
521+
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
540522
- name: Ensure clean build directory
541523
run: rm -rf build
542524
- run: yarn install --frozen-lockfile
543-
- run: yarn install --frozen-lockfile
544-
working-directory: compiler
545525
- name: Restore archived build
546526
uses: actions/download-artifact@v4
547527
with:
@@ -583,18 +563,16 @@ jobs:
583563
with:
584564
node-version-file: '.nvmrc'
585565
cache: yarn
586-
cache-dependency-path: '**/yarn.lock'
566+
cache-dependency-path: yarn.lock
587567
- name: Restore cached node_modules
588568
uses: actions/cache@v4
589569
id: node_modules
590570
with:
591571
path: "**/node_modules"
592-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
572+
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
593573
- name: Ensure clean build directory
594574
run: rm -rf build
595575
- run: yarn install --frozen-lockfile
596-
- run: yarn install --frozen-lockfile
597-
working-directory: compiler
598576
- name: Restore archived build
599577
uses: actions/download-artifact@v4
600578
with:
@@ -622,13 +600,13 @@ jobs:
622600
with:
623601
node-version-file: '.nvmrc'
624602
cache: yarn
625-
cache-dependency-path: '**/yarn.lock'
603+
cache-dependency-path: yarn.lock
626604
- name: Restore cached node_modules
627605
uses: actions/cache@v4
628606
id: node_modules
629607
with:
630608
path: "**/node_modules"
631-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
609+
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
632610
- name: Ensure clean build directory
633611
run: rm -rf build
634612
- run: yarn install --frozen-lockfile
@@ -648,8 +626,6 @@ jobs:
648626
- name: Ensure clean build directory
649627
run: rm -rf build
650628
- run: yarn install --frozen-lockfile
651-
- run: yarn install --frozen-lockfile
652-
working-directory: compiler
653629
- name: Restore archived build for PR
654630
uses: actions/download-artifact@v4
655631
with:

.github/workflows/runtime_eslint_plugin_e2e.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,16 @@ jobs:
3535
with:
3636
node-version-file: '.nvmrc'
3737
cache: yarn
38-
cache-dependency-path: '**/yarn.lock'
38+
cache-dependency-path: yarn.lock
3939
- name: Restore cached node_modules
4040
uses: actions/cache@v4
4141
id: node_modules
4242
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') }}
4545
- name: Ensure clean build directory
4646
run: rm -rf build
4747
- run: yarn install --frozen-lockfile
48-
- run: yarn install --frozen-lockfile
49-
working-directory: compiler
5048
- name: Build plugin
5149
working-directory: fixtures/eslint-v${{ matrix.eslint_major }}
5250
run: node build.mjs

.github/workflows/runtime_prereleases.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ jobs:
3434
with:
3535
node-version-file: '.nvmrc'
3636
cache: yarn
37-
cache-dependency-path: '**/yarn.lock'
37+
cache-dependency-path: yarn.lock
3838
- name: Restore cached node_modules
3939
uses: actions/cache@v4
4040
id: node_modules
4141
with:
4242
path: "**/node_modules"
43-
key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
43+
key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }}
4444
- name: Ensure clean build directory
4545
run: rm -rf build
4646
- run: yarn install --frozen-lockfile

.github/workflows/runtime_releases_from_npm_manual.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ jobs:
6666
with:
6767
node-version-file: '.nvmrc'
6868
cache: yarn
69-
cache-dependency-path: '**/yarn.lock'
69+
cache-dependency-path: yarn.lock
7070
- name: Restore cached node_modules
7171
uses: actions/cache@v4
7272
id: node_modules
7373
with:
7474
path: "**/node_modules"
75-
key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
75+
key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }}
7676
- name: Ensure clean build directory
7777
run: rm -rf build
7878
- run: yarn install --frozen-lockfile

.github/workflows/shared_lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
with:
2525
node-version-file: '.nvmrc'
2626
cache: yarn
27-
cache-dependency-path: '**/yarn.lock'
27+
cache-dependency-path: yarn.lock
2828
- name: Restore cached node_modules
2929
uses: actions/cache@v4
3030
with:
@@ -44,7 +44,7 @@ jobs:
4444
with:
4545
node-version-file: '.nvmrc'
4646
cache: yarn
47-
cache-dependency-path: '**/yarn.lock'
47+
cache-dependency-path: yarn.lock
4848
- name: Restore cached node_modules
4949
uses: actions/cache@v4
5050
with:
@@ -64,7 +64,7 @@ jobs:
6464
with:
6565
node-version-file: '.nvmrc'
6666
cache: yarn
67-
cache-dependency-path: '**/yarn.lock'
67+
cache-dependency-path: yarn.lock
6868
- name: Restore cached node_modules
6969
uses: actions/cache@v4
7070
with:
@@ -84,7 +84,7 @@ jobs:
8484
with:
8585
node-version-file: '.nvmrc'
8686
cache: yarn
87-
cache-dependency-path: '**/yarn.lock'
87+
cache-dependency-path: yarn.lock
8888
- name: Restore cached node_modules
8989
uses: actions/cache@v4
9090
with:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"testRegex": "/scripts/jest/dont-run-jest-directly\\.js$"
119119
},
120120
"scripts": {
121-
"prebuild": "./scripts/react-compiler/link-compiler.sh",
121+
"prebuild": "yarn --cwd compiler install --frozen-lockfile && ./scripts/react-compiler/link-compiler.sh",
122122
"build": "node ./scripts/rollup/build-all-release-channels.js",
123123
"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",
124124
"build-for-devtools-dev": "yarn build-for-devtools --type=NODE_DEV",

scripts/react-compiler/build-compiler.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ if [[ "$REACT_CLASS_EQUIVALENCE_TEST" == "true" ]]; then
1111
fi
1212

1313
echo "Building babel-plugin-react-compiler..."
14+
yarn --cwd compiler install --frozen-lockfile
1415
yarn --cwd compiler workspace babel-plugin-react-compiler build --dts

0 commit comments

Comments
 (0)