name: "Test"

on:
  push:
    branches:
      - main
  pull_request:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node_version: [14, 16, 18]
        include:
          # Active LTS + other OS
          - os: macos-latest
            node_version: 16
          - os: windows-latest
            node_version: 16
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm run tests
