name: Test
on:
  - push
  - pull_request

jobs:
  build:
    runs-on: ubuntu-20.04
    strategy:
      matrix:
        node: [ '12', '14', '16' ]
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Use Node.js ${{ matrix.node }}
        uses: actions/setup-node@v2
        with:
          node-version: ${{ matrix.node }}

      - name: Fetch submodules
        run: git submodule update --init

      - name: Install dependencies
        run: npm ci

      - name: Run test suite
        run: npm run test