on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
  workflow_dispatch:
jobs:
  tests:
    strategy:
      fail-fast: false
      matrix:
        os:
          - macos-11
          - windows-2019
          - ubuntu-18.04
        node_version:
          - 14.16.0
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set up NodeJS ${{ matrix.node_version }}
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node_version }}
      - name: Install node-pre-gyp
        run: npm install -g @mapbox/node-pre-gyp
      - name: Install dependencies
        run: npm install
      - name: Rebuild
        run: npx node-pre-gyp clean configure rebuild
      - name: Test
        run: npm test
