diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index e9eb171..ab2ef63 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -3,25 +3,42 @@ on: [push, pull_request] name: CI jobs: - test-posix: - name: Tests + test-node: + name: Node.js ${{ matrix.node-version }} / ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - node-version: [12.4.0, 12.x, 14.x, 15.x] - exclude: - - os: windows-latest - node-version: 12.4.0 # The node-gyp shipped with this is too old + node-version: [22.x, 24.x, latest] runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v6 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v6 with: - check-latest: true node-version: ${{ matrix.node-version }} - name: Install Dependencies run: npm install - name: Test run: npm test + + test-electron: + name: Electron ${{ matrix.electron-version }} / ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + electron-version: ['37.10.3', '41.1.1', latest] + runs-on: ${{matrix.os}} + steps: + - uses: actions/checkout@v6 + - name: Use Node.js 24.x + uses: actions/setup-node@v6 + with: + node-version: 24.x + - name: Install Dependencies + run: npm install + - name: Install Electron and @electron/rebuild + run: npm install --no-save electron@${{ matrix.electron-version }} @electron/rebuild + - name: Rebuild against Electron headers + run: npx electron-rebuild diff --git a/package.json b/package.json index 2a3c5f5..7d5960c 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "import": "./.esm-wrapper.mjs" }, "engines": { - "node": ">= 12.0.0" + "node": ">=22.0.0" }, "scripts": { "lint": "eslint {src,test}/**/*.ts", diff --git a/src/binding.cc b/src/binding.cc index 678c51b..dd36e23 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -95,7 +95,7 @@ void RunInterruptible(const FunctionCallbackInfo& args) { } NODE_MODULE_INIT() { - Isolate* isolate = context->GetIsolate(); + Isolate* isolate = Isolate::GetCurrent(); exports->Set(context, String::NewFromUtf8( isolate, "runInterruptible", NewStringType::kInternalized)