Skip to content

Commit bce4f64

Browse files
authored
drop support for Node.js versions 16, 21 (#390)
* drop support for Node.js versions 16, 21 * ci: modern node modules caching
1 parent 7a81b23 commit bce4f64

File tree

3 files changed

+38
-55
lines changed

3 files changed

+38
-55
lines changed

.github/workflows/build-test.yml

Lines changed: 22 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,19 @@ jobs:
99
prepare:
1010
name: Prepare
1111
runs-on: ubuntu-latest
12-
outputs:
13-
YARN_CACHE_DIR: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }}
14-
YARN_VERSION: ${{ steps.yarn-version.outputs.YARN_VERSION }}
1512
strategy:
1613
matrix:
17-
node-version: [16.x, 18.x, 20.x]
14+
node-version:
15+
- 18.x
16+
- 20.x
17+
- 22.x
1818
steps:
1919
- uses: actions/checkout@v3
2020
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v4
2222
with:
2323
node-version: ${{ matrix.node-version }}
24-
- name: Get Yarn cache directory
25-
run: echo "YARN_CACHE_DIR=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
26-
id: yarn-cache-dir
27-
- name: Get Yarn version
28-
run: echo "YARN_VERSION=$(yarn --version)" >> "$GITHUB_OUTPUT"
29-
id: yarn-version
30-
- name: Cache Yarn dependencies
31-
uses: actions/cache@v3
32-
with:
33-
path: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }}
34-
key: yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }}
24+
cache: 'yarn'
3525
- name: Install Yarn dependencies
3626
run: yarn --immutable
3727
build:
@@ -41,18 +31,17 @@ jobs:
4131
- prepare
4232
strategy:
4333
matrix:
44-
node-version: [16.x, 18.x, 20.x]
34+
node-version:
35+
- 18.x
36+
- 20.x
37+
- 22.x
4538
steps:
4639
- uses: actions/checkout@v3
4740
- name: Use Node.js ${{ matrix.node-version }}
48-
uses: actions/setup-node@v3
41+
uses: actions/setup-node@v4
4942
with:
5043
node-version: ${{ matrix.node-version }}
51-
- name: Restore Yarn dependencies
52-
uses: actions/cache@v3
53-
with:
54-
path: ${{ needs.prepare.outputs.YARN_CACHE_DIR }}
55-
key: yarn-cache-${{ runner.os }}-${{ needs.prepare.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }}
44+
cache: 'yarn'
5645
- run: yarn --immutable
5746
- run: yarn build
5847
- name: Require clean working directory
@@ -67,20 +56,13 @@ jobs:
6756
runs-on: ubuntu-latest
6857
needs:
6958
- prepare
70-
strategy:
71-
matrix:
72-
node-version: [16.x, 18.x, 20.x]
7359
steps:
7460
- uses: actions/checkout@v3
75-
- name: Use Node.js ${{ matrix.node-version }}
76-
uses: actions/setup-node@v3
77-
with:
78-
node-version: ${{ matrix.node-version }}
79-
- name: Restore Yarn dependencies
80-
uses: actions/cache@v3
61+
- name: Set up Node.js
62+
uses: actions/setup-node@v4
8163
with:
82-
path: ${{ needs.prepare.outputs.YARN_CACHE_DIR }}
83-
key: yarn-cache-${{ runner.os }}-${{ needs.prepare.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }}
64+
node-version-file: '.nvmrc'
65+
cache: 'yarn'
8466
- run: yarn --immutable
8567
- run: yarn lint
8668
- name: Validate RC changelog
@@ -103,18 +85,17 @@ jobs:
10385
- prepare
10486
strategy:
10587
matrix:
106-
node-version: [16.x, 18.x, 20.x]
88+
node-version:
89+
- 18.x
90+
- 20.x
91+
- 22.x
10792
steps:
10893
- uses: actions/checkout@v3
10994
- name: Use Node.js ${{ matrix.node-version }}
110-
uses: actions/setup-node@v3
95+
uses: actions/setup-node@v4
11196
with:
11297
node-version: ${{ matrix.node-version }}
113-
- name: Restore Yarn dependencies
114-
uses: actions/cache@v3
115-
with:
116-
path: ${{ needs.prepare.outputs.YARN_CACHE_DIR }}
117-
key: yarn-cache-${{ runner.os }}-${{ needs.prepare.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }}-${{ matrix.node-version }}
98+
cache: 'yarn'
11899
- run: yarn --immutable
119100
- run: yarn test
120101
- name: Require clean working directory

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"@metamask/eslint-config-nodejs": "^11.1.0",
6060
"@metamask/eslint-config-typescript": "^11.1.0",
6161
"@types/jest": "^27.0.6",
62-
"@types/node": "^16.18.50",
62+
"@types/node": "~18.18.14",
6363
"@typescript-eslint/eslint-plugin": "^5.59.1",
6464
"@typescript-eslint/parser": "^5.59.1",
6565
"ajv": "^8.11.0",
@@ -80,7 +80,7 @@
8080
},
8181
"packageManager": "[email protected]",
8282
"engines": {
83-
"node": "^16.20 || ^18.16 || >=20"
83+
"node": "^18.18 || ^20.14 || >=22"
8484
},
8585
"publishConfig": {
8686
"access": "public",

yarn.lock

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ __metadata:
905905
"@metamask/utils": ^9.0.0
906906
"@scure/base": ~1.1.3
907907
"@types/jest": ^27.0.6
908-
"@types/node": ^16.18.50
908+
"@types/node": ~18.18.14
909909
"@typescript-eslint/eslint-plugin": ^5.59.1
910910
"@typescript-eslint/parser": ^5.59.1
911911
ajv: ^8.11.0
@@ -1243,17 +1243,12 @@ __metadata:
12431243
languageName: node
12441244
linkType: hard
12451245

1246-
"@types/node@npm:*":
1247-
version: 18.7.6
1248-
resolution: "@types/node@npm:18.7.6"
1249-
checksum: 5122988c325eda8d1f5cbe4494916036aae1758f9d5bb2d8139a800b8bad1540fbb167cd3c759da9a5cb4600cd3507609ac7969747113c1549a3e4320a17b1a9
1250-
languageName: node
1251-
linkType: hard
1252-
1253-
"@types/node@npm:^16.18.50":
1254-
version: 16.18.50
1255-
resolution: "@types/node@npm:16.18.50"
1256-
checksum: 8aec1eaf83407197ec2fe947182c238f49b82a7aace867cee1f81f72eb8a76c3c8b2adb1fd356e7443317cffb2546708da8934299a579edd25e3160bf7af30a1
1246+
"@types/node@npm:*, @types/node@npm:~18.18.14":
1247+
version: 18.18.14
1248+
resolution: "@types/node@npm:18.18.14"
1249+
dependencies:
1250+
undici-types: ~5.26.4
1251+
checksum: 3a77e6819e50fd22196b08d542433e1513c855f4993a200bc0e7be076445c61ce2a9e5f7f202f060c46130b2b2f98643461fb7999f874475e6bb322c4534c580
12571252
languageName: node
12581253
linkType: hard
12591254

@@ -5904,6 +5899,13 @@ __metadata:
59045899
languageName: node
59055900
linkType: hard
59065901

5902+
"undici-types@npm:~5.26.4":
5903+
version: 5.26.5
5904+
resolution: "undici-types@npm:5.26.5"
5905+
checksum: 3192ef6f3fd5df652f2dc1cd782b49d6ff14dc98e5dced492aa8a8c65425227da5da6aafe22523c67f035a272c599bb89cfe803c1db6311e44bed3042fc25487
5906+
languageName: node
5907+
linkType: hard
5908+
59075909
"unique-filename@npm:^1.1.1":
59085910
version: 1.1.1
59095911
resolution: "unique-filename@npm:1.1.1"

0 commit comments

Comments
 (0)