Skip to content

Commit cb506b8

Browse files
committed
build: use .nvmrc to determine node version to test and build
1 parent a7177be commit cb506b8

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

.github/workflows/chromatic.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,11 @@ jobs:
4848
with:
4949
# pulls all commits (needed for chromatic to find baselines)
5050
fetch-depth: '0'
51-
- name: Use Node.js 20
51+
- name: Use Node.js
5252
uses: actions/setup-node@v4
5353
with:
54-
node-version: 20
54+
node-version-file: .nvmrc
55+
check-latest: true
5556
cache: 'npm'
5657
- name: Install dependencies
5758
run: npm install

.github/workflows/publish.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,11 @@ jobs:
4545
restore-keys: |
4646
${{ runner.os }}-cache-
4747
48-
- name: Use Node.js 20
48+
- name: Use Node.js
4949
uses: actions/setup-node@v4
5050
with:
51-
node-version: 20
51+
node-version-file: .nvmrc
52+
check-latest: true
5253
cache: 'npm'
5354

5455
- run: npm -v

.github/workflows/tests.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,13 @@ env:
1717
jobs:
1818
test:
1919
runs-on: ubuntu-latest
20-
21-
strategy:
22-
matrix:
23-
node-version: [20]
24-
2520
steps:
2621
- uses: actions/checkout@v4
27-
- name: Use Node.js ${{ matrix.node-version }}
22+
- name: Use Node.js
2823
uses: actions/setup-node@v4
2924
with:
30-
node-version: ${{ matrix.node-version }}
25+
node-version-file: .nvmrc
26+
check-latest: true
3127
cache: 'npm'
3228
- run: npm install
3329
- run: npm run lint
@@ -37,11 +33,6 @@ jobs:
3733

3834
build:
3935
runs-on: ubuntu-latest
40-
41-
strategy:
42-
matrix:
43-
node-version: [20]
44-
4536
steps:
4637
- uses: actions/checkout@v4
4738
- name: Cache build setup
@@ -51,10 +42,11 @@ jobs:
5142
key: ${{ runner.os }}-cache-${{ github.sha }}
5243
restore-keys: |
5344
${{ runner.os }}-cache-
54-
- name: Use Node.js ${{ matrix.node-version }}
45+
- name: Use Node.js
5546
uses: actions/setup-node@v4
5647
with:
57-
node-version: ${{ matrix.node-version }}
48+
node-version-file: .nvmrc
49+
check-latest: true
5850
cache: 'npm'
5951
- run: npm install
6052
- run: npm run build:prod

0 commit comments

Comments
 (0)