From 797102be41b909229be3326421b89aa4baaa924d Mon Sep 17 00:00:00 2001 From: Siim Kallas Date: Tue, 29 Oct 2024 12:52:07 +0200 Subject: [PATCH] CI: Add Node 22 to prebuilds and unit tests (#963) * 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 --- .github/workflows/ci.yml | 12 +++++++++--- binding.gyp | 4 ++-- package-lock.json | 28 +++++++++++++++------------- package.json | 2 +- scripts/prebuild-os.js | 3 ++- 5 files changed, 29 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c16290d8..017e7c40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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' @@ -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' @@ -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 @@ -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 diff --git a/binding.gyp b/binding.gyp index acb4c91a..d5343c0e 100644 --- a/binding.gyp +++ b/binding.gyp @@ -2,7 +2,7 @@ "targets": [{ "target_name": "metrics", "variables": { - "cppstd_ver": "= 20 ? 17 : 11\")" + "cppstd_ver": " {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", @@ -49,7 +49,7 @@ "xcode_settings": { "MACOSX_DEPLOYMENT_TARGET": "10.10", "OTHER_CFLAGS": [ - "-std=c++17", + "-std=c++20", "-stdlib=libc++", "-Wall", "-Werror", diff --git a/package-lock.json b/package-lock.json index c3a65062..f000b733 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,7 +68,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" @@ -7317,9 +7317,10 @@ } }, "node_modules/nan": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.20.0.tgz", - "integrity": "sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw==" + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.0.tgz", + "integrity": "sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw==", + "license": "MIT" }, "node_modules/natural-compare": { "version": "1.4.0", @@ -7370,10 +7371,11 @@ } }, "node_modules/node-abi": { - "version": "3.51.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.51.0.tgz", - "integrity": "sha512-SQkEP4hmNWjlniS5zdnfIXTk1x7Ome85RDzHlTbBtzE97Gfwz/Ipw4v/Ryk20DWIy3yCNVLVlGKApCnmvYoJbA==", + "version": "3.71.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.71.0.tgz", + "integrity": "sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==", "dev": true, + "license": "MIT", "dependencies": { "semver": "^7.3.5" }, @@ -15343,9 +15345,9 @@ } }, "nan": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.20.0.tgz", - "integrity": "sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw==" + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.22.0.tgz", + "integrity": "sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw==" }, "natural-compare": { "version": "1.4.0", @@ -15390,9 +15392,9 @@ } }, "node-abi": { - "version": "3.51.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.51.0.tgz", - "integrity": "sha512-SQkEP4hmNWjlniS5zdnfIXTk1x7Ome85RDzHlTbBtzE97Gfwz/Ipw4v/Ryk20DWIy3yCNVLVlGKApCnmvYoJbA==", + "version": "3.71.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.71.0.tgz", + "integrity": "sha512-SZ40vRiy/+wRTf21hxkkEjPJZpARzUMVcJoQse2EF8qkUWbbO2z7vd5oA/H6bVH6SZQ5STGcu0KRDS7biNRfxw==", "dev": true, "requires": { "semver": "^7.3.5" diff --git a/package.json b/package.json index 0b20f7a3..b70dddf2 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/scripts/prebuild-os.js b/scripts/prebuild-os.js index bef76f80..30322fb1 100644 --- a/scripts/prebuild-os.js +++ b/scripts/prebuild-os.js @@ -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' ]; }