name: Tests
on:
  push:
    branches:
      - $default-branch
  pull_request:
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/setup-go@v2
      with:
        go-version: 1.16
    - uses: actions/checkout@v2
    - name: Test
      run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./...
    - uses: codecov/codecov-action@v1
  go-generate:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/setup-go@v2
      with:
        go-version: 1.16
    - uses: actions/checkout@v2
    - run: go generate ./...
    - name: Check go generate diff
      run: (! git diff | grep '^') # check diff

name: Tests
on:
  push:
    branches:
      - $default-branch
  pull_request:
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/setup-go@v2
      with:
        go-version: 1.16
    - uses: actions/checkout@v2
    - name: Test
      run: go test -v -race -coverpkg=./... -coverprofile=coverage.txt ./...
    - uses: codecov/codecov-action@v2
  go-generate:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/setup-go@v2
      with:
        go-version: 1.16
    - uses: actions/checkout@v2
    - run: go generate ./...
    - name: Check go generate diff
      run: (! git diff | grep '^') # check diff

Update codecov/codecov-action action to v2
Update codecov/codecov-action action to v2
