Skip to content

Commit be29efb

Browse files
committed
feat(repo): codecov integration
1 parent 667556e commit be29efb

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.codecov.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
codecov:
2+
max_report_age: 24h
3+
4+
coverage:
5+
round: nearest
6+
range: 40..100

.github/workflows/test.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,23 @@ jobs:
1818
uses: actions/setup-go@v5
1919
with:
2020
go-version-file: go.mod
21+
- name: Install gotestsum
22+
run: go install gotest.tools/gotestsum@latest
2123
- name: Test
22-
run: go test $(go list ./... | grep -v '/gen$') -coverprofile coverage.out
24+
run: gotestsum --junitfile report.xml -- -coverprofile=coverage.out $(go list ./... | grep -v '/gen$')
2325
- name: Report coverage
2426
uses: codecov/codecov-action@v5
2527
with:
2628
token: ${{ secrets.CODECOV_TOKEN }}
29+
files: ./coverage.out
2730
flags: unit
2831
name: ${{ join(matrix.*, ' ') }}
32+
- name: Upload test results to Codecov
33+
if: ${{ !cancelled() }}
34+
uses: codecov/test-results-action@v1
35+
with:
36+
files: report.xml
37+
token: ${{ secrets.CODECOV_TOKEN }}
2938

3039
build:
3140
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)