name: CI

on: pull_request

jobs:
  ci:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [12.x, 14.x, 16.x]

    steps:
      - uses: actions/checkout@v2

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

      - name: Run tests
        run: node ./test/runTests.js

      - name: Run tests
        run: node ./test/validateModuleExportsMatchCommonJS/index.js
        if: matrix.node-version == '16.x'
