name: CI build

on:
  pull_request:
    branches: [ master, next, beta, alpha ]

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [16.x]

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

      - name: Installing dependencies
        run: npm i --ignore-scripts
      - name: Running tests
        run: |
              npm test
              npx nyc --reporter=lcov npm test && npx codecov
        env:
          CI: true
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v2
        
      - name: Running Linter - ESLint
        run: npm run lint

