Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 31 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,19 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel]
os: [ubuntu-latest, windows-latest, macos-15-intel]
node-version: [20.x, 22.x, 24.x]
arch: [x64]
include:
- os: macos-latest
node-version: 20.x
arch: arm64
- os: macos-latest
node-version: 22.x
arch: arm64
- os: macos-latest
node-version: 24.x
arch: arm64
- os: windows-latest
node-version: 20.x
arch: x86
Expand Down Expand Up @@ -48,23 +57,34 @@ jobs:
shell: bash
run: npm run prebuild

# Consumers resolve node-addon-api from our semver range, not our lockfile,
# so also build against the newest release to catch header changes early.
- name: Build and test against latest node-addon-api
shell: bash
run: |
npm install --no-save node-addon-api@latest
npm run build
npm run test

test-mingw:
name: Test MinGW (MSYS2 MINGW64) on Windows
name: Test MinGW (MSYS2 UCRT64) on Windows
runs-on: windows-latest

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Set up MSYS2 with MINGW64
# MSYS2 no longer builds nodejs for the MINGW64 (msvcrt) environment;
# UCRT64 is its replacement and uses the same GCC/MinGW-w64 toolchain.
- name: Set up MSYS2 with UCRT64
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
msystem: UCRT64
update: true
install: >-
mingw-w64-x86_64-nodejs
mingw-w64-x86_64-python
mingw-w64-x86_64-gcc
mingw-w64-ucrt-x86_64-nodejs
mingw-w64-ucrt-x86_64-python
mingw-w64-ucrt-x86_64-gcc
make

- name: Verify MinGW Node.js is active
Expand Down Expand Up @@ -94,7 +114,10 @@ jobs:
shell: msys2 {0}
run: |
test ! -e node_modules/node-gyp || { echo "local node-gyp shadows the MSYS2 one"; exit 1; }
node-gyp --version
# The UCRT64 package only ships node-gyp.cmd in bin/, which bash can't run, and
# npm's node-gyp-bin shim only resolves correctly when npm sets
# $npm_config_node_gyp for a lifecycle script. Call npm's node-gyp directly.
node "$MINGW_PREFIX/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" --version

- name: Build native tests
shell: msys2 {0}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- os: windows-latest
arch: x86
- os: macos-latest
arch: x64
arch: arm64
- os: macos-15-intel
arch: x64

Expand Down
3 changes: 1 addition & 2 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'OTHER_CPLUSPLUSFLAGS' : [ '-std=c++11', '-stdlib=libc++' ],
'MACOSX_DEPLOYMENT_TARGET': '10.15',
},
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@napi-ffi/ffi-napi",
"version": "4.0.7",
"version": "4.0.8",
"license": "MIT",
"author": "Anna Henningsen <anna@addaleax.net>",
"contributors": [
Expand Down Expand Up @@ -33,7 +33,7 @@
"@napi-ffi/get-uv-event-loop-napi-h": "^1.0.6",
"node-addon-api": "^8.2.1",
"node-gyp-build": "^4.8.2",
"@napi-ffi/ref-napi": "^3.0.9",
"@napi-ffi/ref-napi": "^3.0.10",
"@napi-ffi/ref-struct-di": "^1.1.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion test/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'MACOSX_DEPLOYMENT_TARGET': '10.15',
},
'msvs_settings': {
'VCCLCompilerTool': { 'ExceptionHandling': 1 },
Expand Down