name: Unit tests on: pull_request: push: branches: - main concurrency: group: tests-${{ github.head_ref || github.ref }}-${{ github.repository }} cancel-in-progress: true jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Install Go uses: actions/setup-go@v3 with: go-version: 1.17.x - uses: actions/cache@v3.0.11 with: path: | ~/go/pkg/mod ~/.cache/go-build key: ${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-test-go-${{ hashFiles('**/go.sum') }} - name: Run tests run: | make unit-tests - name: Codecov uses: codecov/codecov-action@v3 with: file: ./coverage.out