Update nodejs.yml #86
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node CI | |
on: | |
push: | |
branches: | |
- '*' | |
- '!master' | |
pull_request: | |
branches: | |
- 'master' | |
jobs: | |
build: | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
node-version: [18,20] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Node v${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: npm install, build, and test | |
run: | | |
npm install | |
npm run build --if-present | |
npm test | |
- name: ensure universal binary (arm64/x86_64) | |
run: | | |
file fsevents.node | |
file fsevents.node | grep -q arm64 || (echo "arm64 binary not built"; exit 1) | |
file fsevents.node | grep -q x86_64 || (echo "x86_64 binary not built"; exit 1) | |
- name: Upload binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: binary | |
path: fsevents.node | |
env: | |
CI: true | |
test_macos_10: | |
name: 'Test universal binary on macOS 10.15' | |
runs-on: macos-10.15 | |
needs: build | |
strategy: | |
matrix: | |
node-version: [18,20] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Node v${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: npm install | |
run: | | |
npm install --ignore-scripts | |
- name: Download universal binary | |
uses: actions/download-artifact@v2 | |
with: | |
name: binary | |
- name: ensure universal binary (arm64/x86_64) | |
run: | | |
file fsevents.node | |
file fsevents.node | grep -q arm64 || (echo "arm64 binary not built"; exit 1) | |
file fsevents.node | grep -q x86_64 || (echo "x86_64 binary not built"; exit 1) | |
- name: npm test | |
run: | | |
npm test | |
env: | |
CI: true |