name: Test

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - '**'

jobs:
  test:
    name: Test on Node.js ${{ matrix.node-version }} and ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        node-version: ['14']
        os: [ubuntu-latest]
    steps:
    - uses: actions/checkout@v1
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - name: npm install
      run: npm install
    - name: npm run test
      run: npm run test
    - name: coverage
      if: matrix.os == 'ubuntu-latest' && matrix.node-version == '12'
      run: cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js | rm -rf ./coverage
