Skip to content

Commit 2cd37d1

Browse files
authored
ci: run corepack enable before installing dependencies (#244)
* ci: run `corepack enable` as part of prepare * chore(ci): do redundant setup-node step before checkout to enable yarn v4 before deps install - makes nodejs version `lts/*` explicit in ci workflow
1 parent 663cdea commit 2cd37d1

File tree

1 file changed

+34
-4
lines changed

1 file changed

+34
-4
lines changed

.github/workflows/build-lint-test.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,17 @@ jobs:
88
name: Prepare
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
1211
- name: Use Node.js
1312
uses: actions/setup-node@v4
1413
with:
15-
node-version-file: '.nvmrc'
14+
node-version: 'lts/*'
15+
- name: Install Yarn
16+
run: corepack enable
17+
- uses: actions/checkout@v4
18+
- name: Use Node.js and install dependencies
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: 'lts/*'
1622
cache: 'yarn'
1723
- name: Install Yarn dependencies
1824
run: yarn --immutable
@@ -23,11 +29,17 @@ jobs:
2329
needs:
2430
- prepare
2531
steps:
32+
- name: Use Node.js
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: 'lts/*'
36+
- name: Install Yarn
37+
run: corepack enable
2638
- uses: actions/checkout@v4
2739
- name: Use Node.js
2840
uses: actions/setup-node@v4
2941
with:
30-
node-version-file: '.nvmrc'
42+
node-version: 'lts/*'
3143
cache: 'yarn'
3244
- run: yarn --immutable --immutable-cache
3345
- run: yarn build
@@ -45,11 +57,17 @@ jobs:
4557
needs:
4658
- prepare
4759
steps:
60+
- name: Use Node.js
61+
uses: actions/setup-node@v4
62+
with:
63+
node-version: 'lts/*'
64+
- name: Install Yarn
65+
run: corepack enable
4866
- uses: actions/checkout@v4
4967
- name: Use Node.js
5068
uses: actions/setup-node@v4
5169
with:
52-
node-version-file: '.nvmrc'
70+
node-version: 'lts/*'
5371
cache: 'yarn'
5472
- run: yarn --immutable --immutable-cache
5573
- run: yarn lint
@@ -76,6 +94,12 @@ jobs:
7694
matrix:
7795
node-version: [18.x, 20.x]
7896
steps:
97+
- name: Use Node.js
98+
uses: actions/setup-node@v4
99+
with:
100+
node-version: ${{ matrix.node-version }}
101+
- name: Install Yarn
102+
run: corepack enable
79103
- uses: actions/checkout@v4
80104
- name: Use Node.js ${{ matrix.node-version }}
81105
uses: actions/setup-node@v4
@@ -101,6 +125,12 @@ jobs:
101125
matrix:
102126
node-version: [18.x, 20.x]
103127
steps:
128+
- name: Use Node.js
129+
uses: actions/setup-node@v4
130+
with:
131+
node-version: ${{ matrix.node-version }}
132+
- name: Install Yarn
133+
run: corepack enable
104134
- uses: actions/checkout@v4
105135
- name: Use Node.js ${{ matrix.node-version }}
106136
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)