name: Verify
on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  verify:

    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [14.x, 16.x]
        # See supported Node.js release schedule at https://nodejs.org/en/about/releases/

    steps:
    - uses: actions/checkout@v3
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm ci
    - name: Lint, Test, And Coverage
      run: npm run test && npm run test:cover
    - name: Coverage Upload
      if: ${{ success() }}
      uses: coverallsapp/github-action@master
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        path-to-lcov: ./coverage/lcov.info