Skip to content

Commit 6b2b519

Browse files
committed
ci: add node.js 20 setup
Run tests on Node.js 20
1 parent 2f1b650 commit 6b2b519

File tree

5 files changed

+30
-6
lines changed

5 files changed

+30
-6
lines changed

.github/workflows/ci.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,20 @@ jobs:
107107
fail-fast: false
108108
matrix:
109109
os: [ubuntu-latest, windows-latest]
110-
node: [18]
110+
node: [18, 20]
111111
subset: [npm, yarn, esbuild]
112112
shard: [0, 1, 2, 3, 4, 5]
113113
exclude:
114-
# Exclude Node.js v16 when running on a PR
115-
- node: ${{ github.event_name != 'pull_request' && 'none' || '16' }}
114+
# Exclude Node.js v18 when running on a PR
115+
- node: ${{ github.event_name != 'pull_request' && 'none' || '18' }}
116116
# Exclude Windows when running on a PR
117117
- os: ${{ github.event_name != 'pull_request' && 'none' || 'windows-latest' }}
118-
# Skip yarn subset for Windows
118+
# Skip yarn subset on Windows
119119
- os: windows-latest
120120
subset: yarn
121+
# Skip node 18 tests on Windows
122+
- os: windows-latest
123+
node: 18
121124
runs-on: ${{ matrix.os }}
122125
steps:
123126
- name: Initialize environment

WORKSPACE

+15
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,21 @@ nodejs_register_toolchains(
6262
node_version = "18.13.0",
6363
)
6464

65+
nodejs_register_toolchains(
66+
name = "node20",
67+
# The below can be removed once @rules_nodejs/nodejs is updated to latest which contains https://github.com/bazelbuild/rules_nodejs/pull/3701
68+
node_repositories = {
69+
"20.9.0-darwin_arm64": ("node-v20.9.0-darwin-arm64.tar.gz", "node-v20.9.0-darwin-arm64", "31d2d46ae8d8a3982f54e2ff1e60c2e4a8e80bf78a3e8b46dcaac95ac5d7ce6a"),
70+
"20.9.0-darwin_amd64": ("node-v20.9.0-darwin-x64.tar.gz", "node-v20.9.0-darwin-x64", "fc5b73f2a78c17bbe926cdb1447d652f9f094c79582f1be6471b4b38a2e1ccc8"),
71+
"20.9.0-linux_arm64": ("node-v20.9.0-linux-arm64.tar.xz", "node-v20.9.0-linux-arm64", "ced3ecece4b7c3a664bca3d9e34a0e3b9a31078525283a6fdb7ea2de8ca5683b"),
72+
"20.9.0-linux_ppc64le": ("node-v20.9.0-linux-ppc64le.tar.xz", "node-v20.9.0-linux-ppc64le", "3c6cea5d614cfbb95d92de43fbc2f8ecd66e431502fe5efc4f3c02637897bd45"),
73+
"20.9.0-linux_s390x": ("node-v20.9.0-linux-s390x.tar.xz", "node-v20.9.0-linux-s390x", "af1f4e63756ff685d452166c4d5ba93a308e816ee7c46015b5e086163d9f011b"),
74+
"20.9.0-linux_amd64": ("node-v20.9.0-linux-x64.tar.xz", "node-v20.9.0-linux-x64", "9033989810bf86220ae46b1381bdcdc6c83a0294869ba2ad39e1061f1e69217a"),
75+
"20.9.0-windows_amd64": ("node-v20.9.0-win-x64.zip", "node-v20.9.0-win-x64", "70d87dad2378c63216ff83d5a754c61d2886fc39d32ce0d2ea6de763a22d3780"),
76+
},
77+
node_version = "20.9.0",
78+
)
79+
6580
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
6681

6782
yarn_install(

constants.bzl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Engine versions to stamp in a release package.json
2-
RELEASE_ENGINES_NODE = ">=18.13.0"
2+
RELEASE_ENGINES_NODE = "^18.13.0 || >=20.9.0"
33
RELEASE_ENGINES_NPM = "^6.11.0 || ^7.5.6 || >=8.0.0"
44
RELEASE_ENGINES_YARN = ">= 1.13.0"
55

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"url": "https://github.com/angular/angular-cli.git"
4040
},
4141
"engines": {
42-
"node": "^18.13.0",
42+
"node": "^18.13.0 || ^20.9.0",
4343
"yarn": ">=1.21.1 <2",
4444
"npm": "Please use yarn instead of NPM to install dependencies"
4545
},

tools/toolchain_info.bzl

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# the order will match against the order in the TOOLCHAIN_VERSION list.
55
TOOLCHAINS_NAMES = [
66
"node18",
7+
"node20",
78
]
89

910
# this is the list of toolchains that should be used and are registered with nodejs_register_toolchains in the WORKSPACE file
@@ -13,6 +14,11 @@ TOOLCHAINS_VERSIONS = [
1314
"@bazel_tools//src/conditions:darwin": "@node18_darwin_amd64//:node_toolchain",
1415
"@bazel_tools//src/conditions:windows": "@node18_windows_amd64//:node_toolchain",
1516
}),
17+
select({
18+
"@bazel_tools//src/conditions:linux_x86_64": "@node20_linux_amd64//:node_toolchain",
19+
"@bazel_tools//src/conditions:darwin": "@node20_darwin_amd64//:node_toolchain",
20+
"@bazel_tools//src/conditions:windows": "@node20_windows_amd64//:node_toolchain",
21+
}),
1622
]
1723

1824
# A default toolchain for use when only one is necessary

0 commit comments

Comments
 (0)