Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add GitHub Action to test the code on Linux, macOS, and Windows #264

Merged
merged 14 commits into from
Mar 27, 2024
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: ci
on:
push:
# branches: [ master ]
pull_request:
branches: [ master ]
jobs:
ci:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node-version: [18.x, 20.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install -y build-essential libgl1-mesa-dri libglapi-mesa
libglew-dev libglu1-mesa-dev libosmesa6
libxi-dev mesa-utils pkg-config
- run: npm ci
- run: npm run build --if-present
- if: startsWith(matrix.os, 'ubuntu')
run: xvfb-run npm test
- if: "!startsWith(matrix.os, 'ubuntu')"
run: npm test