Skip to content

Commit ef1103d

Browse files
authored
[ci] Fix node_modules cache glob (#32604)
Seems like the stringified cache path can cause some directories not to be cached, trying an alternative format
1 parent 6733870 commit ef1103d

10 files changed

+93
-62
lines changed

.github/workflows/compiler_playground.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ jobs:
3636
uses: actions/cache@v4
3737
id: node_modules
3838
with:
39-
path: "**/node_modules"
40-
key: compiler-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/**/yarn.lock') }}
39+
path: |
40+
**/node_modules
41+
key: compiler-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/**/yarn.lock') }}
4142
- run: yarn install --frozen-lockfile
4243
- run: npx playwright install --with-deps chromium
4344
- run: CI=true yarn test

.github/workflows/compiler_prereleases.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ jobs:
4646
uses: actions/cache@v4
4747
id: node_modules
4848
with:
49-
path: "**/node_modules"
50-
key: compiler-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/**/yarn.lock') }}
49+
path: |
50+
**/node_modules
51+
key: compiler-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/**/yarn.lock') }}
5152
- run: yarn install --frozen-lockfile
5253
- name: Publish packages to npm
5354
run: |

.github/workflows/compiler_typescript.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ jobs:
4646
- name: Restore cached node_modules
4747
uses: actions/cache@v4
4848
with:
49-
path: "**/node_modules"
50-
key: compiler-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/**/yarn.lock') }}
49+
path: |
50+
**/node_modules
51+
key: compiler-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/**/yarn.lock') }}
5152
- run: yarn install --frozen-lockfile
5253
- run: yarn workspace babel-plugin-react-compiler lint
5354

@@ -66,8 +67,9 @@ jobs:
6667
uses: actions/cache@v4
6768
id: node_modules
6869
with:
69-
path: "**/node_modules"
70-
key: compiler-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/**/yarn.lock') }}
70+
path: |
71+
**/node_modules
72+
key: compiler-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/**/yarn.lock') }}
7173
- run: yarn install --frozen-lockfile
7274
- run: yarn workspace babel-plugin-react-compiler jest
7375

@@ -90,8 +92,9 @@ jobs:
9092
uses: actions/cache@v4
9193
id: node_modules
9294
with:
93-
path: "**/node_modules"
94-
key: compiler-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/**/yarn.lock') }}
95+
path: |
96+
**/node_modules
97+
key: compiler-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('compiler/**/yarn.lock') }}
9598
- run: yarn install --frozen-lockfile
9699
- run: xvfb-run -a yarn workspace ${{ matrix.workspace_name }} test
97100
if: runner.os == 'Linux' && matrix.workspace_name == 'react-forgive'

.github/workflows/devtools_regression_tests.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ jobs:
2929
uses: actions/cache@v4
3030
id: node_modules
3131
with:
32-
path: "**/node_modules"
33-
key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }}
32+
path: |
33+
**/node_modules
34+
key: runtime-release-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }}
3435
- name: Ensure clean build directory
3536
run: rm -rf build
3637
- run: yarn install --frozen-lockfile
@@ -63,8 +64,9 @@ jobs:
6364
uses: actions/cache@v4
6465
id: node_modules
6566
with:
66-
path: "**/node_modules"
67-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
67+
path: |
68+
**/node_modules
69+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
6870
- name: Ensure clean build directory
6971
run: rm -rf build
7072
- run: yarn install --frozen-lockfile
@@ -120,8 +122,9 @@ jobs:
120122
uses: actions/cache@v4
121123
id: node_modules
122124
with:
123-
path: "**/node_modules"
124-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
125+
path: |
126+
**/node_modules
127+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
125128
- run: yarn install --frozen-lockfile
126129
- name: Restore all archived build artifacts
127130
uses: actions/download-artifact@v4
@@ -154,8 +157,9 @@ jobs:
154157
uses: actions/cache@v4
155158
id: node_modules
156159
with:
157-
path: "**/node_modules"
158-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
160+
path: |
161+
**/node_modules
162+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
159163
- run: yarn install --frozen-lockfile
160164
- name: Restore all archived build artifacts
161165
uses: actions/download-artifact@v4

.github/workflows/runtime_build_and_test.yml

+42-28
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ jobs:
5555
uses: actions/cache@v4
5656
id: node_modules
5757
with:
58-
path: "**/node_modules"
59-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
58+
path: |
59+
**/node_modules
60+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
6061
- name: Ensure clean build directory
6162
run: rm -rf build
6263
- run: yarn install --frozen-lockfile
@@ -79,8 +80,9 @@ jobs:
7980
uses: actions/cache@v4
8081
id: node_modules
8182
with:
82-
path: "**/node_modules"
83-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
83+
path: |
84+
**/node_modules
85+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
8486
- name: Ensure clean build directory
8587
run: rm -rf build
8688
- run: yarn install --frozen-lockfile
@@ -107,8 +109,9 @@ jobs:
107109
uses: actions/cache@v4
108110
id: node_modules
109111
with:
110-
path: "**/node_modules"
111-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
112+
path: |
113+
**/node_modules
114+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
112115
- name: Ensure clean build directory
113116
run: rm -rf build
114117
- run: yarn install --frozen-lockfile
@@ -162,8 +165,9 @@ jobs:
162165
uses: actions/cache@v4
163166
id: node_modules
164167
with:
165-
path: "**/node_modules"
166-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
168+
path: |
169+
**/node_modules
170+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
167171
- name: Ensure clean build directory
168172
run: rm -rf build
169173
- run: yarn install --frozen-lockfile
@@ -198,8 +202,9 @@ jobs:
198202
uses: actions/cache@v4
199203
id: node_modules
200204
with:
201-
path: "**/node_modules"
202-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
205+
path: |
206+
**/node_modules
207+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
203208
- name: Ensure clean build directory
204209
run: rm -rf build
205210
- run: yarn install --frozen-lockfile
@@ -274,8 +279,9 @@ jobs:
274279
uses: actions/cache@v4
275280
id: node_modules
276281
with:
277-
path: "**/node_modules"
278-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
282+
path: |
283+
**/node_modules
284+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
279285
- name: Ensure clean build directory
280286
run: rm -rf build
281287
- run: yarn install --frozen-lockfile
@@ -308,8 +314,9 @@ jobs:
308314
uses: actions/cache@v4
309315
id: node_modules
310316
with:
311-
path: "**/node_modules"
312-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
317+
path: |
318+
**/node_modules
319+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
313320
- name: Ensure clean build directory
314321
run: rm -rf build
315322
- run: yarn install --frozen-lockfile
@@ -357,8 +364,9 @@ jobs:
357364
uses: actions/cache@v4
358365
id: node_modules
359366
with:
360-
path: "**/node_modules"
361-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
367+
path: |
368+
**/node_modules
369+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
362370
- name: Ensure clean build directory
363371
run: rm -rf build
364372
- run: yarn install --frozen-lockfile
@@ -394,8 +402,9 @@ jobs:
394402
uses: actions/cache@v4
395403
id: node_modules
396404
with:
397-
path: "**/node_modules"
398-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
405+
path: |
406+
**/node_modules
407+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
399408
- name: Ensure clean build directory
400409
run: rm -rf build
401410
- run: yarn install --frozen-lockfile
@@ -428,8 +437,9 @@ jobs:
428437
uses: actions/cache@v4
429438
id: node_modules
430439
with:
431-
path: "**/node_modules"
432-
key: fixtures_dom-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('fixtures/dom/yarn.lock') }}
440+
path: |
441+
**/node_modules
442+
key: fixtures_dom-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('fixtures/dom/yarn.lock') }}
433443
- name: Ensure clean build directory
434444
run: rm -rf build
435445
- run: yarn install --frozen-lockfile
@@ -471,8 +481,9 @@ jobs:
471481
uses: actions/cache@v4
472482
id: node_modules
473483
with:
474-
path: "**/node_modules"
475-
key: fixtures_flight-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
484+
path: |
485+
**/node_modules
486+
key: fixtures_flight-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
476487
- name: Ensure clean build directory
477488
run: rm -rf build
478489
- run: yarn install --frozen-lockfile
@@ -535,8 +546,9 @@ jobs:
535546
uses: actions/cache@v4
536547
id: node_modules
537548
with:
538-
path: "**/node_modules"
539-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
549+
path: |
550+
**/node_modules
551+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
540552
- name: Ensure clean build directory
541553
run: rm -rf build
542554
- run: yarn install --frozen-lockfile
@@ -588,8 +600,9 @@ jobs:
588600
uses: actions/cache@v4
589601
id: node_modules
590602
with:
591-
path: "**/node_modules"
592-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
603+
path: |
604+
**/node_modules
605+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
593606
- name: Ensure clean build directory
594607
run: rm -rf build
595608
- run: yarn install --frozen-lockfile
@@ -627,8 +640,9 @@ jobs:
627640
uses: actions/cache@v4
628641
id: node_modules
629642
with:
630-
path: "**/node_modules"
631-
key: runtime-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
643+
path: |
644+
**/node_modules
645+
key: runtime-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
632646
- name: Ensure clean build directory
633647
run: rm -rf build
634648
- run: yarn install --frozen-lockfile

.github/workflows/runtime_commit_artifacts.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ jobs:
7373
uses: actions/cache@v4
7474
id: node_modules
7575
with:
76-
path: "**/node_modules"
77-
key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }}
76+
path: |
77+
**/node_modules
78+
key: runtime-release-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('yarn.lock', 'scripts/release/yarn.lock') }}
7879
- name: Ensure clean build directory
7980
run: rm -rf build
8081
- run: yarn install --frozen-lockfile

.github/workflows/runtime_eslint_plugin_e2e.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ jobs:
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: |
44+
**/node_modules
45+
key: runtime-eslint_e2e-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
4546
- name: Ensure clean build directory
4647
run: rm -rf build
4748
- run: yarn install --frozen-lockfile

.github/workflows/runtime_prereleases.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ jobs:
3939
uses: actions/cache@v4
4040
id: node_modules
4141
with:
42-
path: "**/node_modules"
43-
key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
42+
path: |
43+
**/node_modules
44+
key: runtime-release-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
4445
- name: Ensure clean build directory
4546
run: rm -rf build
4647
- run: yarn install --frozen-lockfile

.github/workflows/runtime_releases_from_npm_manual.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,9 @@ jobs:
7171
uses: actions/cache@v4
7272
id: node_modules
7373
with:
74-
path: "**/node_modules"
75-
key: runtime-release-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
74+
path: |
75+
**/node_modules
76+
key: runtime-release-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
7677
- name: Ensure clean build directory
7778
run: rm -rf build
7879
- run: yarn install --frozen-lockfile

.github/workflows/shared_lint.yml

+12-8
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ jobs:
2828
- name: Restore cached node_modules
2929
uses: actions/cache@v4
3030
with:
31-
path: "**/node_modules"
32-
key: shared-lint-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
31+
path: |
32+
**/node_modules
33+
key: shared-lint-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
3334
- name: Ensure clean build directory
3435
run: rm -rf build
3536
- run: yarn install --frozen-lockfile
@@ -48,8 +49,9 @@ jobs:
4849
- name: Restore cached node_modules
4950
uses: actions/cache@v4
5051
with:
51-
path: "**/node_modules"
52-
key: shared-lint-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
52+
path: |
53+
**/node_modules
54+
key: shared-lint-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
5355
- name: Ensure clean build directory
5456
run: rm -rf build
5557
- run: yarn install --frozen-lockfile
@@ -68,8 +70,9 @@ jobs:
6870
- name: Restore cached node_modules
6971
uses: actions/cache@v4
7072
with:
71-
path: "**/node_modules"
72-
key: shared-lint-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
73+
path: |
74+
**/node_modules
75+
key: shared-lint-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
7376
- name: Ensure clean build directory
7477
run: rm -rf build
7578
- run: yarn install --frozen-lockfile
@@ -88,8 +91,9 @@ jobs:
8891
- name: Restore cached node_modules
8992
uses: actions/cache@v4
9093
with:
91-
path: "**/node_modules"
92-
key: shared-lint-node_modules-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
94+
path: |
95+
**/node_modules
96+
key: shared-lint-node_modules-v2-${{ runner.arch }}-${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
9397
- name: Ensure clean build directory
9498
run: rm -rf build
9599
- run: yarn install --frozen-lockfile

0 commit comments

Comments
 (0)