name: Test

on: [push]

jobs:
  build:

    runs-on: ubuntu-latest

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

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm install
    - run: npm test
      env:
        CI: true
    - run: npm run codecov
      env:
        CI: true
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1

name: Test

on: [push, pull_request]

jobs:
  build:

    runs-on: ubuntu-latest

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

    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v1
      with:
        node-version: ${{ matrix.node-version }}
    - run: npm install
    - run: npm test
      env:
        CI: true
    - run: npm run codecov
      env:
        CI: true
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1

Add pull request event to GitHub Actions
Add pull request event to GitHub Actions

Pull Requests from a fork do not trigger the push event, which means
tests are not run by GitHub Actions when someone opens a pull request
from a fork. Adding the pull request event trigger fixes this.
