From 6083b9ae542e51d8da5c442f5b2574945f50d4ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Cruz?= Date: Sun, 1 Nov 2026 15:42:09 +0000 Subject: [PATCH 1/2] test: use process.ppid instead of wmic in win-ppid fixture wmic is no longer installed by default on Windows Server 2025 and Windows 11 24H2, which made the "should NOT spawn a shell for a .exe" test fail. process.ppid is available since Node.js 9.2. --- appveyor.yml | 27 --------------------------- test/fixtures/win-ppid.js | 12 +----------- 2 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 51ec227..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,27 +0,0 @@ -# http://www.appveyor.com/docs/appveyor-yml - -# Fix line endings in Windows -init: - - git config --global core.autocrlf input - -environment: - matrix: - - nodejs_version: 18 - - nodejs_version: 20 - - nodejs_version: 22 - -install: - - ps: Install-Product node $env:nodejs_version - - ps: | - if ($env:npm_version) - { - npm install -g npm@$env:npm_version - } - - npm install - -build: off - -test_script: - - node --version - - npm --version - - cmd: npm test --no-color diff --git a/test/fixtures/win-ppid.js b/test/fixtures/win-ppid.js index 8702fbc..156ccfc 100755 --- a/test/fixtures/win-ppid.js +++ b/test/fixtures/win-ppid.js @@ -2,14 +2,4 @@ 'use strict'; -const spawnSync = require('child_process').spawnSync; - -function ppidSync() { - const res = spawnSync('wmic', - ['process', 'where', `(processid=${process.pid})`, 'get', 'parentprocessid']); - const lines = res.stdout.toString().split(/\r?\n/); - - return parseInt(lines[1].trim(), 10); -} - -console.log(ppidSync()); +console.log(process.ppid); From 5fda26f26b7e8fd7ab4aa87e907e8127547a7f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Cruz?= Date: Sun, 1 Nov 2026 15:42:10 +0000 Subject: [PATCH 2/2] chore: replace appveyor with github workflows windows runners Run the unit tests on both ubuntu-latest and windows-latest, run lint once, and also run CI on pull requests. --- .github/workflows/ci.yaml | 22 ++++++++++++++++++---- README.md | 4 +--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b9636bf..6121502 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,13 +1,29 @@ name: CI -on: [push] +on: [push, pull_request] jobs: - unit: + lint: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '22' + + - run: npm ci + + - run: npm run lint + + unit: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false matrix: + os: [ubuntu-latest, windows-latest] node-version: ['18', '20', '22'] steps: @@ -19,6 +35,4 @@ jobs: - run: npm ci - - run: npm run lint - - run: npm test diff --git a/README.md b/README.md index 1ed9252..5faf66a 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,12 @@ # cross-spawn -[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Build status][appveyor-image]][appveyor-url] +[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [npm-url]:https://npmjs.org/package/cross-spawn [downloads-image]:https://img.shields.io/npm/dm/cross-spawn.svg [npm-image]:https://img.shields.io/npm/v/cross-spawn.svg [ci-url]:https://github.com/moxystudio/node-cross-spawn/actions/workflows/ci.yaml [ci-image]:https://github.com/moxystudio/node-cross-spawn/actions/workflows/ci.yaml/badge.svg -[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn -[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg A cross platform solution to node's spawn and spawnSync.