# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Run tests

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

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [12, 14, 16]
        include:
            - node: 14
              reportCoverage: true

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}
    - name: Install Dependencies
      run: npm install
    - name: Run tests
      run: |
        npm run test
        npm run coverage
    - name: Publish to coveralls.io
      if: ${{ matrix.reportCoverage }}
      env:
          BLAH: ${{ matrix.reportCoverage }}
      run: echo Reporting coverage $BLAH
    - name: Publish to coveralls.io
      if: ${{ matrix.reportCoverage }}
      uses: coverallsapp/github-action@v1.1.2
      with:
        github-token: ${{ github.token }}

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Run tests

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

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [12, 14, 16]
    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v2
      with:
        node-version: ${{ matrix.node-version }}
    - name: Install Dependencies
      run: npm install
    - name: Run tests
      run: |
        npm run test
        npm run coverage
    - name: Publish to coveralls.io
      if: ${{ matrix.node == 14 }}
      uses: coverallsapp/github-action@v1.1.2
      with:
        github-token: ${{ github.token }}

Check node version before reporting coverage
Check node version before reporting coverage
