d3d2d63176323b2b89bbe40d4ad498ad164e518e
- Author
- Ayman Bagabas <ayman.bagabas@gmail.com>
- Committer
- Ayman Bagabas <ayman.bagabas@gmail.com>
- Date
Message
feat(ci): add code coverage
Diff
1diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
2index c9fcf3fb28b29034f04695a1afe8712c97ec6eea..53d50461026a1f6f2a04fa9787b9a8bd40d0db9f 100644
3--- a/.github/workflows/build.yml
4+++ b/.github/workflows/build.yml
5@@ -9,4 +9,21 @@ jobs:
6 snapshot:
7 uses: charmbracelet/meta/.github/workflows/snapshot.yml@main
8 secrets:
9- goreleaser_key: ${{ secrets.GORELEASER_KEY }}
10+ goreleaser_key: ${{ secrets.GORELEASER_KEY }}
11+
12+ coverage:
13+ runs-on: ubuntu-latest
14+ if: ${{ github.event_name == 'pull_request' }}
15+ steps:
16+ - uses: actions/checkout@v3
17+
18+ - name: Set up Go
19+ uses: actions/setup-go@v3
20+ with:
21+ go-version: ^1
22+
23+ - name: Test
24+ run: go test -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt ./... -timeout 5m
25+ - uses: codecov/codecov-action@v3
26+ with:
27+ file: ./coverage.txt