Skip to content

Run GitHub Actions tests on macOS #469

Run GitHub Actions tests on macOS

Run GitHub Actions tests on macOS #469

Workflow file for this run

name: CI
on:
pull_request:
branches: [master]
push:
branches: [master]
jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [18.x, 20.x, 22.x]
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: npm
- if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get install -y build-essential libglew-dev libglu1-mesa-dev libxi-dev pkg-config
ls /usr/include/c++/
# export CXXFLAGS='-include /usr/include/c++/11.2.0/limits'
- name: Install deps and build (with cache)
run: |
touch ./dist
rm package-lock.json
npm i
- name: Lint
run: npm run lint
- name: Test
run: |
# TODO: Remove the disabling of the following files.
mv src/neural-network-gpu.end-to-end.test.ts src/neural-network-gpu.end-to-end.test.ts.DISABLED
mv src/neural-network.bitwise.test.ts src/neural-network.bitwise.test.ts.DISABLED
mv src/neural-network.trainopts.test.ts src/neural-network.trainopts.test.ts.DISABLED
mv src/recurrent.end-to-end.test.ts src/recurrent.end-to-end.test.ts.DISABLED
mv src/recurrent/gru.test.ts src/recurrent/gru.test.ts.DISABLED
mv src/recurrent/lstm-time-step.end-to-end.test.ts src/recurrent/lstm-time-step.end-to-end.test.ts.DISABLED
mv src/recurrent/lstm.test.ts src/recurrent/lstm.test.ts.DISABLED
mv src/recurrent/rnn-time-step.test.ts src/recurrent/rnn-time-step.test.ts.DISABLED
mv src/recurrent/rnn.test.ts src/recurrent/rnn.test.ts.DISABLED
npm run test --ci --coverage --maxWorkers=2
- name: Build
run: npm run build
- name: Codecov
uses: codecov/codecov-action@v3