Skip to content

Update nodejs.yml

Update nodejs.yml #90

Workflow file for this run

name: Node CI
on:
push:
branches:
- '*'
- '!master'
pull_request:
branches:
- 'master'
jobs:
build:
runs-on: macos-latest
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:
name: 'Test universal binary on macOS 10.15'
runs-on: macos-latest
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