Skip to content

Commit

Permalink
ci: add node.js 20 setup
Browse files Browse the repository at this point in the history
Run tests on Node.js 20
  • Loading branch information
alan-agius4 committed Oct 30, 2023
1 parent 09682e5 commit ebfc8ea
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
node: [18]
node: [18, 20]
subset: [npm, yarn, esbuild]
shard: [0, 1, 2, 3, 4, 5]
exclude:
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [18]
node: [18, 20]
subset: [npm, yarn, esbuild]
shard: [0, 1, 2, 3, 4, 5]
runs-on: ${{ matrix.os }}
Expand Down
15 changes: 15 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@ nodejs_register_toolchains(
node_version = "18.13.0",
)

nodejs_register_toolchains(
name = "node20",
# The below can be removed once @rules_nodejs/nodejs is updated to latest which contains https://github.com/bazelbuild/rules_nodejs/pull/3701
node_repositories = {
"20.9.0-darwin_arm64": ("node-v20.9.0-darwin-arm64.tar.gz", "node-v20.9.0-darwin-arm64", "31d2d46ae8d8a3982f54e2ff1e60c2e4a8e80bf78a3e8b46dcaac95ac5d7ce6a"),
"20.9.0-darwin_amd64": ("node-v20.9.0-darwin-x64.tar.gz", "node-v20.9.0-darwin-x64", "fc5b73f2a78c17bbe926cdb1447d652f9f094c79582f1be6471b4b38a2e1ccc8"),
"20.9.0-linux_arm64": ("node-v20.9.0-linux-arm64.tar.xz", "node-v20.9.0-linux-arm64", "ced3ecece4b7c3a664bca3d9e34a0e3b9a31078525283a6fdb7ea2de8ca5683b"),
"20.9.0-linux_ppc64le": ("node-v20.9.0-linux-ppc64le.tar.xz", "node-v20.9.0-linux-ppc64le", "3c6cea5d614cfbb95d92de43fbc2f8ecd66e431502fe5efc4f3c02637897bd45"),
"20.9.0-linux_s390x": ("node-v20.9.0-linux-s390x.tar.xz", "node-v20.9.0-linux-s390x", "af1f4e63756ff685d452166c4d5ba93a308e816ee7c46015b5e086163d9f011b"),
"20.9.0-linux_amd64": ("node-v20.9.0-linux-x64.tar.xz", "node-v20.9.0-linux-x64", "9033989810bf86220ae46b1381bdcdc6c83a0294869ba2ad39e1061f1e69217a"),
"20.9.0-windows_amd64": ("node-v20.9.0-win-x64.zip", "node-v20.9.0-win-x64", "70d87dad2378c63216ff83d5a754c61d2886fc39d32ce0d2ea6de763a22d3780"),
},
node_version = "20.9.0",
)

load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")

yarn_install(
Expand Down
2 changes: 1 addition & 1 deletion constants.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Engine versions to stamp in a release package.json
RELEASE_ENGINES_NODE = ">=18.13.0"
RELEASE_ENGINES_NODE = "^18.13.0 || >=20.9.0"
RELEASE_ENGINES_NPM = "^6.11.0 || ^7.5.6 || >=8.0.0"
RELEASE_ENGINES_YARN = ">= 1.13.0"

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"url": "https://github.com/angular/angular-cli.git"
},
"engines": {
"node": "^18.13.0",
"node": "^18.13.0 || ^20.9.0",
"yarn": ">=1.21.1 <2",
"npm": "Please use yarn instead of NPM to install dependencies"
},
Expand Down
6 changes: 6 additions & 0 deletions tools/toolchain_info.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# the order will match against the order in the TOOLCHAIN_VERSION list.
TOOLCHAINS_NAMES = [
"node18",
"node20",
]

# this is the list of toolchains that should be used and are registered with nodejs_register_toolchains in the WORKSPACE file
Expand All @@ -13,6 +14,11 @@ TOOLCHAINS_VERSIONS = [
"@bazel_tools//src/conditions:darwin": "@node18_darwin_amd64//:node_toolchain",
"@bazel_tools//src/conditions:windows": "@node18_windows_amd64//:node_toolchain",
}),
select({
"@bazel_tools//src/conditions:linux_x86_64": "@node20_linux_amd64//:node_toolchain",
"@bazel_tools//src/conditions:darwin": "@node20_darwin_amd64//:node_toolchain",
"@bazel_tools//src/conditions:windows": "@node20_windows_amd64//:node_toolchain",
}),
]

# A default toolchain for use when only one is necessary
Expand Down

0 comments on commit ebfc8ea

Please sign in to comment.