name: Tests
on: [ push, pull_request ]
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
        with:
          fetch-depth: 2
      - uses: actions/setup-go@v2
        with:
          go-version: '1.18'
      - name: Run tests with coverage
        run: go test -coverprofile=coverage.out -covermode=count ./...
      - uses: codecov/codecov-action@v2
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: ./coverage.out
          flags: unittests
          name: codecov-umbrella
          fail_ci_if_error: true
          verbose: true