on: [push, pull_request]
name: Generate coverage report
jobs:
  coverage:
    runs-on: ubuntu-latest
    steps:
    - name: Install Go
      uses: actions/setup-go@v2
      with:
        go-version: 1.15.x
    - name: Checkout code
      uses: actions/checkout@v2
    - name: Generate coverage report
      run: |
        make coverage
    - name: Upload coverage to Codecov
      uses: codecov/codecov-action@v1
      with:
        file: ./coverage.txt
