name: test
on:
  push:
    branches:
    - 'main'
    - 'master'
  pull_request:

defaults:
  run:
    shell: bash

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest]
        node: [14, 16, 18]
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 1
      - uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node }}

      - name: npm ci
        run: npm ci --ignore-scripts

      - name: test
        run: npm test
