/ .github / workflows / nodejs-tests.yml
nodejs-tests.yml
 1  name: NodeJS
 2  on:
 3    push:
 4      branches:
 5        - main
 6    pull_request:
 7      branches:
 8        - main
 9  
10  jobs:
11    tests:
12      runs-on: ${{matrix.os}}
13      strategy:
14        matrix:
15          os:
16            - ubuntu-latest
17            - macos-latest
18            - windows-latest
19          node:
20            - 16
21            - 18
22      steps:
23        - uses: actions/checkout@v3
24          with:
25            submodules: recursive
26        - name: Setup Node.js ${{matrix.node}}
27          uses: actions/setup-node@v1
28          with:
29            node-version: ${{matrix.node}}
30        - name: Setup Python
31          uses: actions/setup-python@v4
32          with:
33            python-version: '3.10'
34        - name: Install setuptools
35          run: |
36            python -m pip install --upgrade pip
37            pip install setuptools
38        - name: Check formatting
39          if: matrix.os == 'ubuntu-latest'
40          working-directory: bindings/node.js
41          run: make format
42        - name: Build/test bindings
43          working-directory: bindings/node.js
44          run: make build test bundle
45        - name: Install distribution
46          working-directory: bindings/node.js/dist
47          run: npm install