Skip to content

Commit f103967

Browse files
authoredMar 8, 2024
fix(ci): align pnpm install across all workflows (#5920)
* fix(ci): align pnpm install across all workflows * fix(ci): skip running build before unit tests Unit tests doesn't require packages to be built since jest is configured to use the devAliases, routing imports from `<package>` to `<package>/src`. * fixup! fix(ci): skip running build before unit tests
1 parent e3bfee0 commit f103967

15 files changed

+281
-237
lines changed
 

‎.github/workflows/cli-test.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,33 @@ jobs:
3737
with:
3838
node-version: ${{ matrix.node }}
3939

40-
- name: Install pnpm
41-
run: corepack enable && pnpm --version
40+
- uses: pnpm/action-setup@v2
41+
name: Install pnpm
42+
id: pnpm-install
43+
with:
44+
version: 8
45+
run_install: false
46+
47+
- name: Get pnpm store directory
48+
id: pnpm-cache
49+
shell: bash
50+
run: |
51+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
4252
4353
- name: Cache node modules
4454
id: cache-node-modules
4555
uses: actions/cache@v4
4656
env:
4757
cache-name: cache-node-modules
4858
with:
49-
path: '**/node_modules'
50-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
59+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
60+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
5161
restore-keys: |
52-
${{ runner.os }}-modules-${{ env.cache-name }}-
53-
${{ runner.os }}-modules-
54-
${{ runner.os }}-
62+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
63+
v1-${{ runner.os }}-pnpm-store-
64+
v1-${{ runner.os }}-
5565
5666
- name: Install project dependencies
57-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
5867
run: pnpm install
5968

6069
- name: Build CLI

‎.github/workflows/depCheck.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,33 @@ jobs:
1111
with:
1212
node-version: 18
1313

14-
- name: Install pnpm
15-
run: corepack enable && pnpm --version
14+
- uses: pnpm/action-setup@v2
15+
name: Install pnpm
16+
id: pnpm-install
17+
with:
18+
version: 8
19+
run_install: false
20+
21+
- name: Get pnpm store directory
22+
id: pnpm-cache
23+
shell: bash
24+
run: |
25+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
1626
1727
- name: Cache node modules
1828
id: cache-node-modules
1929
uses: actions/cache@v4
2030
env:
2131
cache-name: cache-node-modules
2232
with:
23-
path: '**/node_modules'
24-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
33+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
34+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
2535
restore-keys: |
26-
${{ runner.os }}-modules-${{ env.cache-name }}-
27-
${{ runner.os }}-modules-
28-
${{ runner.os }}-
36+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
37+
v1-${{ runner.os }}-pnpm-store-
38+
v1-${{ runner.os }}-
2939
3040
- name: Install project dependencies
31-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
3241
run: pnpm install
3342

3443
- name: Check for unused/missing dependencies

‎.github/workflows/docReport.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,33 @@ jobs:
2222
with:
2323
node-version: 18
2424

25-
- name: Install pnpm
26-
run: corepack enable && pnpm --version
25+
- uses: pnpm/action-setup@v2
26+
name: Install pnpm
27+
id: pnpm-install
28+
with:
29+
version: 8
30+
run_install: false
31+
32+
- name: Get pnpm store directory
33+
id: pnpm-cache
34+
shell: bash
35+
run: |
36+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
2737
2838
- name: Cache node modules
2939
id: cache-node-modules
3040
uses: actions/cache@v4
3141
env:
3242
cache-name: cache-node-modules
3343
with:
34-
path: '**/node_modules'
35-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
44+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
45+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3646
restore-keys: |
37-
${{ runner.os }}-modules-${{ env.cache-name }}-
38-
${{ runner.os }}-modules-
39-
${{ runner.os }}-
47+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
48+
v1-${{ runner.os }}-pnpm-store-
49+
v1-${{ runner.os }}-
4050
4151
- name: Install project dependencies
42-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
4352
run: pnpm install
4453

4554
- name: Build packages

‎.github/workflows/e2e-ct.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,33 @@ jobs:
1818
with:
1919
node-version: 18
2020

21-
- name: Install pnpm
22-
run: corepack enable && pnpm --version
21+
- uses: pnpm/action-setup@v2
22+
name: Install pnpm
23+
id: pnpm-install
24+
with:
25+
version: 8
26+
run_install: false
27+
28+
- name: Get pnpm store directory
29+
id: pnpm-cache
30+
shell: bash
31+
run: |
32+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
2333
2434
- name: Cache node modules
2535
id: cache-node-modules
2636
uses: actions/cache@v4
2737
env:
2838
cache-name: cache-node-modules
2939
with:
30-
path: '**/node_modules'
31-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
40+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
41+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3242
restore-keys: |
33-
${{ runner.os }}-modules-${{ env.cache-name }}-
34-
${{ runner.os }}-modules-
35-
${{ runner.os }}-
43+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
44+
v1-${{ runner.os }}-pnpm-store-
45+
v1-${{ runner.os }}-
3646
3747
- name: Install project dependencies
38-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
3948
run: pnpm install
4049

4150
- name: Store Playwright's Version

‎.github/workflows/e2e-pte.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,33 @@ jobs:
2525
with:
2626
node-version: 18
2727

28-
- name: Install pnpm
29-
run: corepack enable && pnpm --version
28+
- uses: pnpm/action-setup@v2
29+
name: Install pnpm
30+
id: pnpm-install
31+
with:
32+
version: 8
33+
run_install: false
34+
35+
- name: Get pnpm store directory
36+
id: pnpm-cache
37+
shell: bash
38+
run: |
39+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
3040
3141
- name: Cache node modules
3242
id: cache-node-modules
3343
uses: actions/cache@v4
3444
env:
3545
cache-name: cache-node-modules
3646
with:
37-
path: '**/node_modules'
38-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
47+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
48+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3949
restore-keys: |
40-
${{ runner.os }}-modules-${{ env.cache-name }}-
41-
${{ runner.os }}-modules-
42-
${{ runner.os }}-
50+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
51+
v1-${{ runner.os }}-pnpm-store-
52+
v1-${{ runner.os }}-
4353
4454
- name: Install project dependencies
45-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
4655
run: pnpm install
4756

4857
- name: Store Playwright's Version

‎.github/workflows/etl.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,33 @@ jobs:
2424
with:
2525
node-version: 18
2626

27-
- name: Install pnpm
28-
run: corepack enable && pnpm --version
27+
- uses: pnpm/action-setup@v2
28+
name: Install pnpm
29+
id: pnpm-install
30+
with:
31+
version: 8
32+
run_install: false
33+
34+
- name: Get pnpm store directory
35+
id: pnpm-cache
36+
shell: bash
37+
run: |
38+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
2939
3040
- name: Cache node modules
3141
id: cache-node-modules
3242
uses: actions/cache@v4
3343
env:
3444
cache-name: cache-node-modules
3545
with:
36-
path: '**/node_modules'
37-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
46+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
47+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3848
restore-keys: |
39-
${{ runner.os }}-modules-${{ env.cache-name }}-
40-
${{ runner.os }}-modules-
41-
${{ runner.os }}-
49+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
50+
v1-${{ runner.os }}-pnpm-store-
51+
v1-${{ runner.os }}-
4252
4353
- name: Install project dependencies
44-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
4554
run: pnpm install
4655

4756
- name: Build packages

‎.github/workflows/formatCheck.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,33 @@ jobs:
1616
with:
1717
node-version: 18
1818

19-
- name: Install pnpm
20-
run: corepack enable && pnpm --version
19+
- uses: pnpm/action-setup@v2
20+
name: Install pnpm
21+
id: pnpm-install
22+
with:
23+
version: 8
24+
run_install: false
25+
26+
- name: Get pnpm store directory
27+
id: pnpm-cache
28+
shell: bash
29+
run: |
30+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
2131
2232
- name: Cache node modules
2333
id: cache-node-modules
2434
uses: actions/cache@v4
2535
env:
2636
cache-name: cache-node-modules
2737
with:
28-
path: '**/node_modules'
29-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
38+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
39+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3040
restore-keys: |
31-
${{ runner.os }}-modules-${{ env.cache-name }}-
32-
${{ runner.os }}-modules-
33-
${{ runner.os }}-
41+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
42+
v1-${{ runner.os }}-pnpm-store-
43+
v1-${{ runner.os }}-
3444
3545
- name: Install project dependencies
36-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
3746
run: pnpm install
3847

3948
- name: Run format check

‎.github/workflows/lint-fix-if-needed.yml

+19-8
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,35 @@ jobs:
2525
with:
2626
node-version: lts/*
2727

28-
- name: Install pnpm
29-
run: corepack enable && pnpm --version
28+
- uses: pnpm/action-setup@v2
29+
name: Install pnpm
30+
id: pnpm-install
31+
with:
32+
version: 8
33+
run_install: false
34+
35+
- name: Get pnpm store directory
36+
id: pnpm-cache
37+
shell: bash
38+
run: |
39+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
3040
3141
- name: Cache node modules
3242
id: cache-node-modules
3343
uses: actions/cache@v4
3444
env:
3545
cache-name: cache-node-modules
3646
with:
37-
path: '**/node_modules'
38-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
47+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
48+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3949
restore-keys: |
40-
${{ runner.os }}-modules-${{ env.cache-name }}-
41-
${{ runner.os }}-modules-
42-
${{ runner.os }}-
50+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
51+
v1-${{ runner.os }}-pnpm-store-
52+
v1-${{ runner.os }}-
53+
4354
- name: Install project dependencies
44-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
4555
run: pnpm install
56+
4657
- name: Cache ESLint cache
4758
uses: actions/cache@v4
4859
with:

‎.github/workflows/lintPr.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,33 @@ jobs:
1818
- name: Checkout
1919
uses: actions/checkout@v4
2020

21-
- name: Install pnpm
22-
run: corepack enable && pnpm --version
21+
- uses: pnpm/action-setup@v2
22+
name: Install pnpm
23+
id: pnpm-install
24+
with:
25+
version: 8
26+
run_install: false
27+
28+
- name: Get pnpm store directory
29+
id: pnpm-cache
30+
shell: bash
31+
run: |
32+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
2333
2434
- name: Cache node modules
2535
id: cache-node-modules
2636
uses: actions/cache@v4
2737
env:
2838
cache-name: cache-node-modules
2939
with:
30-
path: '**/node_modules'
31-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
40+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
41+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3242
restore-keys: |
33-
${{ runner.os }}-modules-${{ env.cache-name }}-
34-
${{ runner.os }}-modules-
35-
${{ runner.os }}-
43+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
44+
v1-${{ runner.os }}-pnpm-store-
45+
v1-${{ runner.os }}-
3646
3747
- name: Install project dependencies
38-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
3948
run: pnpm install
4049

4150
- name: Lint files

‎.github/workflows/perf.yml

+17-9
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,33 @@ jobs:
1515
with:
1616
node-version: 18
1717

18-
- name: Install pnpm
19-
run: corepack enable && pnpm --version
18+
- uses: pnpm/action-setup@v2
19+
name: Install pnpm
20+
id: pnpm-install
21+
with:
22+
version: 8
23+
run_install: false
24+
25+
- name: Get pnpm store directory
26+
id: pnpm-cache
27+
shell: bash
28+
run: |
29+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
2030
2131
- name: Cache node modules
2232
id: cache-node-modules
2333
uses: actions/cache@v4
2434
env:
2535
cache-name: cache-node-modules
2636
with:
27-
path: '**/node_modules'
28-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
37+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
38+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
2939
restore-keys: |
30-
${{ runner.os }}-modules-${{ env.cache-name }}-
31-
${{ runner.os }}-modules-
32-
${{ runner.os }}-
40+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
41+
v1-${{ runner.os }}-pnpm-store-
42+
v1-${{ runner.os }}-
3343
3444
- name: Install project dependencies
35-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
36-
working-directory: ./perf
3745
run: pnpm install
3846

3947
- name: Store Playwright's Version

‎.github/workflows/pnpm-if-needed.yml

+19-8
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,35 @@ jobs:
2828
with:
2929
node-version: 18
3030

31-
- name: Install pnpm
32-
run: corepack enable && pnpm --version
31+
- uses: pnpm/action-setup@v2
32+
name: Install pnpm
33+
id: pnpm-install
34+
with:
35+
version: 8
36+
run_install: false
37+
38+
- name: Get pnpm store directory
39+
id: pnpm-cache
40+
shell: bash
41+
run: |
42+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
3343
3444
- name: Cache node modules
3545
id: cache-node-modules
3646
uses: actions/cache@v4
3747
env:
3848
cache-name: cache-node-modules
3949
with:
40-
path: '**/node_modules'
41-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
50+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
51+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
4252
restore-keys: |
43-
${{ runner.os }}-modules-${{ env.cache-name }}-
44-
${{ runner.os }}-modules-
45-
${{ runner.os }}-
53+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
54+
v1-${{ runner.os }}-pnpm-store-
55+
v1-${{ runner.os }}-
56+
4657
- name: Install project dependencies
47-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
4858
run: pnpm install --config.ignore-scripts=true
59+
4960
- run: pnpm dedupe --config.ignore-scripts=true
5061
- uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2
5162
id: generate-token

‎.github/workflows/pr-cleanup.yml

+34-16
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,33 @@ jobs:
2020
with:
2121
node-version: 18
2222

23-
- name: Install pnpm
24-
run: corepack enable && pnpm --version
23+
- uses: pnpm/action-setup@v2
24+
name: Install pnpm
25+
id: pnpm-install
26+
with:
27+
version: 8
28+
run_install: false
29+
30+
- name: Get pnpm store directory
31+
id: pnpm-cache
32+
shell: bash
33+
run: |
34+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
2535
2636
- name: Cache node modules
2737
id: cache-node-modules
2838
uses: actions/cache@v4
2939
env:
3040
cache-name: cache-node-modules
3141
with:
32-
path: '**/node_modules'
33-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
42+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
43+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3444
restore-keys: |
35-
${{ runner.os }}-modules-${{ env.cache-name }}-
36-
${{ runner.os }}-modules-
37-
${{ runner.os }}-
45+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
46+
v1-${{ runner.os }}-pnpm-store-
47+
v1-${{ runner.os }}-
3848
3949
- name: Install project dependencies
40-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
4150
run: pnpm install
4251

4352
- name: Remove docs report datasets for closed PRs
@@ -59,24 +68,33 @@ jobs:
5968
- name: Checkout
6069
uses: actions/checkout@v4
6170

62-
- name: Install pnpm
63-
run: corepack enable && pnpm --version
71+
- uses: pnpm/action-setup@v2
72+
name: Install pnpm
73+
id: pnpm-install
74+
with:
75+
version: 8
76+
run_install: false
77+
78+
- name: Get pnpm store directory
79+
id: pnpm-cache
80+
shell: bash
81+
run: |
82+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
6483
6584
- name: Cache node modules
6685
id: cache-node-modules
6786
uses: actions/cache@v4
6887
env:
6988
cache-name: cache-node-modules
7089
with:
71-
path: '**/node_modules'
72-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
90+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
91+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
7392
restore-keys: |
74-
${{ runner.os }}-modules-${{ env.cache-name }}-
75-
${{ runner.os }}-modules-
76-
${{ runner.os }}-
93+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
94+
v1-${{ runner.os }}-pnpm-store-
95+
v1-${{ runner.os }}-
7796
7897
- name: Install project dependencies
79-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
8098
run: pnpm install
8199

82100
- name: Remove E2E datasets for closed PRs

‎.github/workflows/prettier-if-needed.yml

+19-8
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,35 @@ jobs:
2525
with:
2626
node-version: lts/*
2727

28-
- name: Install pnpm
29-
run: corepack enable && pnpm --version
28+
- uses: pnpm/action-setup@v2
29+
name: Install pnpm
30+
id: pnpm-install
31+
with:
32+
version: 8
33+
run_install: false
34+
35+
- name: Get pnpm store directory
36+
id: pnpm-cache
37+
shell: bash
38+
run: |
39+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
3040
3141
- name: Cache node modules
3242
id: cache-node-modules
3343
uses: actions/cache@v4
3444
env:
3545
cache-name: cache-node-modules
3646
with:
37-
path: '**/node_modules'
38-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
47+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
48+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
3949
restore-keys: |
40-
${{ runner.os }}-modules-${{ env.cache-name }}-
41-
${{ runner.os }}-modules-
42-
${{ runner.os }}-
50+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
51+
v1-${{ runner.os }}-pnpm-store-
52+
v1-${{ runner.os }}-
53+
4354
- name: Install project dependencies
44-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
4555
run: pnpm install --config.ignore-scripts=true
56+
4657
- name: Cache Prettier
4758
uses: actions/cache@v4
4859
with:

‎.github/workflows/test.yml

+20-116
Original file line numberDiff line numberDiff line change
@@ -8,68 +8,6 @@ on:
88
branches: [next]
99

1010
jobs:
11-
install:
12-
timeout-minutes: 60
13-
name: Install (${{ matrix.os }} / node ${{ matrix.node }})
14-
runs-on: ${{ matrix.os }}
15-
env:
16-
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
17-
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
18-
continue-on-error: ${{ matrix.experimental }}
19-
20-
strategy:
21-
fail-fast: false
22-
matrix:
23-
os: [ubuntu-latest]
24-
node: [18, 20]
25-
experimental: [false]
26-
# include:
27-
# - os: windows-latest
28-
# node: 16
29-
# experimental: true
30-
31-
steps:
32-
- name: Checkout
33-
uses: actions/checkout@v4
34-
35-
- name: Setup node
36-
uses: actions/setup-node@v4
37-
with:
38-
node-version: ${{ matrix.node }}
39-
40-
- name: Install pnpm
41-
run: corepack enable && pnpm --version
42-
43-
- name: Cache node modules
44-
id: cache-node-modules
45-
uses: actions/cache@v4
46-
env:
47-
cache-name: cache-node-modules
48-
with:
49-
path: '**/node_modules'
50-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
51-
restore-keys: |
52-
${{ runner.os }}-modules-${{ env.cache-name }}-
53-
${{ runner.os }}-modules-
54-
${{ runner.os }}-
55-
56-
- name: Cache build
57-
id: cache-build
58-
uses: actions/cache@v4
59-
env:
60-
cache-name: cache-build
61-
with:
62-
path: './*'
63-
# Unique key for a workflow run. Should be invalidated in the next run
64-
key: ${{ runner.os }}-build-${{ matrix.node }}-${{ env.cache-name }}-${{ github.run_id }}
65-
66-
- name: Install project dependencies
67-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
68-
run: pnpm install
69-
70-
- name: Build CLI
71-
run: pnpm build # Needed for CLI tests
72-
7311
test:
7412
timeout-minutes: 60
7513
name: Test (${{ matrix.os }} / node ${{ matrix.node }})
@@ -78,7 +16,6 @@ jobs:
7816
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
7917
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
8018
continue-on-error: ${{ matrix.experimental }}
81-
needs: [install]
8219

8320
strategy:
8421
# we want to know if a test fails on a specific node version
@@ -103,35 +40,33 @@ jobs:
10340
with:
10441
node-version: ${{ matrix.node }}
10542

106-
- name: Install pnpm
107-
run: corepack enable && pnpm --version
43+
- uses: pnpm/action-setup@v2
44+
name: Install pnpm
45+
id: pnpm-install
46+
with:
47+
version: 8
48+
run_install: false
10849

109-
- name: Restore node_modules cache
110-
uses: actions/cache/restore@v4
111-
id: restore-node-modules
50+
- name: Get pnpm store directory
51+
id: pnpm-cache
52+
shell: bash
53+
run: |
54+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
55+
56+
- name: Cache node modules
57+
id: cache-node-modules
58+
uses: actions/cache@v4
11259
env:
11360
cache-name: cache-node-modules
11461
with:
115-
path: '**/node_modules'
116-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
62+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
63+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
11764
restore-keys: |
118-
${{ runner.os }}-modules-${{ env.cache-name }}-
119-
${{ runner.os }}-modules-
120-
${{ runner.os }}-
121-
122-
- name: Restore build cache
123-
uses: actions/cache/restore@v4
124-
id: restore-build
125-
env:
126-
cache-name: cache-build
127-
with:
128-
path: ./*
129-
key: ${{ runner.os }}-build-${{ matrix.node }}-${{ env.cache-name }}-${{ github.run_id }}
130-
# If the cached build from the pervious step is not available. Fail the build
131-
fail-on-cache-miss: true
65+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
66+
v1-${{ runner.os }}-pnpm-store-
67+
v1-${{ runner.os }}-
13268
13369
- name: Install project dependencies
134-
if: steps.restore-node-modules.outputs.cache-hit != 'true'
13570
run: pnpm install
13671

13772
- name: Test
@@ -142,34 +77,3 @@ jobs:
14277
pnpm test -- --silent --shard=${{ matrix.shardIndex}}/${{ matrix.shardTotal }} --ignoreProjects=@sanity/cli
14378
env:
14479
GITHUB_SHARD_IDENTIFIER: ${{ matrix.shardIndex }}-${{ matrix.shardTotal }}
145-
146-
cleanup:
147-
timeout-minutes: 60
148-
name: Cleanup (${{ matrix.os }} / node ${{ matrix.node }})
149-
runs-on: ${{ matrix.os }}
150-
continue-on-error: ${{ matrix.experimental }}
151-
needs: [test]
152-
153-
strategy:
154-
# we want to know if a test fails on a specific node version
155-
fail-fast: false
156-
matrix:
157-
os: [ubuntu-latest]
158-
node: [18, 20]
159-
experimental: [false]
160-
161-
steps:
162-
- name: Checkout
163-
uses: actions/checkout@v4
164-
165-
- name: Setup node
166-
uses: actions/setup-node@v4
167-
with:
168-
node-version: ${{ matrix.node }}
169-
170-
# Delete the cache so it is only used once
171-
- name: Delete Cache
172-
run: gh cache delete ${{ runner.os }}-build-${{ matrix.node }}-${{ env.cache-name }}-${{ github.run_id }}
173-
env:
174-
cache-name: cache-build
175-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/typeCheck.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,33 @@ jobs:
1111
with:
1212
node-version: 18
1313

14-
- name: Install pnpm
15-
run: corepack enable && pnpm --version
14+
- uses: pnpm/action-setup@v2
15+
name: Install pnpm
16+
id: pnpm-install
17+
with:
18+
version: 8
19+
run_install: false
20+
21+
- name: Get pnpm store directory
22+
id: pnpm-cache
23+
shell: bash
24+
run: |
25+
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
1626
1727
- name: Cache node modules
1828
id: cache-node-modules
1929
uses: actions/cache@v4
2030
env:
2131
cache-name: cache-node-modules
2232
with:
23-
path: '**/node_modules'
24-
key: ${{ runner.os }}-modules-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
33+
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
34+
key: ${{ runner.os }}-pnpm-store-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }}
2535
restore-keys: |
26-
${{ runner.os }}-modules-${{ env.cache-name }}-
27-
${{ runner.os }}-modules-
28-
${{ runner.os }}-
36+
v1-${{ runner.os }}-pnpm-store-${{ env.cache-name }}-
37+
v1-${{ runner.os }}-pnpm-store-
38+
v1-${{ runner.os }}-
2939
3040
- name: Install project dependencies
31-
if: steps.cache-node-modules.outputs.cache-hit != 'true'
3241
run: pnpm install
3342

3443
- name: Check type system

0 commit comments

Comments
 (0)
Please sign in to comment.