Skip to content

Commit

Permalink
CI: Add Node 22 to prebuilds and unit tests (#963)
Browse files Browse the repository at this point in the history
* add node 22 and 23 to ci

* update deps

* upgrade binding cppstd version logic for node 23

* drop node23 from ci

* use setup-node v4

* use setup-node v3 and node 22.10 for windows unit tests
  • Loading branch information
seemk authored Oct 29, 2024
1 parent d747bab commit 797102b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 20 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
node_api_target: '20.0.0'
- container: 'node:16.0.0'
node_api_target: '21.2.0'
- container: 'node:16.0.0'
node_api_target: '22.0.0'
container: ${{ matrix.container }}
steps:
- name: Checkout
Expand All @@ -47,6 +49,8 @@ jobs:
node_api_target: '20.0.0'
- container: 'node:16.0.0'
node_api_target: '21.2.0'
- container: 'node:16.0.0'
node_api_target: '22.0.0'
container: ${{ matrix.container }}
steps:
- name: Checkout
Expand All @@ -67,7 +71,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-2019, macos-12]
node_api_target: ['14.0.0', '15.0.0', '16.0.0', '17.0.1', '18.0.0', '20.0.0', '21.2.0']
node_api_target: ['14.0.0', '15.0.0', '16.0.0', '17.0.1', '18.0.0', '20.0.0', '21.2.0', '22.0.0']
include:
- os: macos-12
python_version: '3.11'
Expand Down Expand Up @@ -131,7 +135,7 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest']
nodejs: ['14', '16', '17', '18', '20', '21']
nodejs: ['14', '16', '17', '18', '20', '21', '22']
exclude:
- os: 'macos-latest'
nodejs: '14'
Expand All @@ -153,6 +157,8 @@ jobs:
nodejs: '20.12.1'
- os: 'windows-2019'
nodejs: '21.7.2'
- os: 'windows-2019'
nodejs: '22.10.0'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -178,7 +184,7 @@ jobs:
fail-fast: false
matrix:
os: ['ARM64']
nodejs: ['14', '16', '17', '18', '20', '21']
nodejs: ['14', '16', '17', '18', '20', '21', '22']
container: node:${{ matrix.nodejs }}
steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"targets": [{
"target_name": "metrics",
"variables": {
"cppstd_ver": "<!(node -pe \"parseInt(process.versions.node.split('.')[0]) >= 20 ? 17 : 11\")"
"cppstd_ver": "<!(node -pe \"(() => {let v = parseInt(process.versions.node.split('.')[0]); if (v >= 23) return 20; else if (v >= 20) return 17; else return 11;})()\")"
},
"sources": [
"src/native_ext/util/arena.cpp",
Expand Down Expand Up @@ -49,7 +49,7 @@
"xcode_settings": {
"MACOSX_DEPLOYMENT_TARGET": "10.10",
"OTHER_CFLAGS": [
"-std=c++17",
"-std=c++20",
"-stdlib=libc++",
"-Wall",
"-Werror",
Expand Down
28 changes: 15 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"@opentelemetry/semantic-conventions": "1.27.0",
"@opentelemetry/winston-transport": "0.6.0",
"is-promise": "^4.0.0",
"nan": "^2.20.0",
"nan": "^2.22.0",
"node-gyp-build": "^4.8.2",
"protobufjs": "^7.4.0",
"semver": "^7.6.3"
Expand Down
3 changes: 2 additions & 1 deletion scripts/prebuild-os.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ if (targets.length == 0) {
'18.0.0',
'19.0.0',
'20.0.0',
'21.2.0'
'21.2.0',
'22.0.0'
];
}

Expand Down

0 comments on commit 797102b

Please sign in to comment.