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. 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);