Skip to content

Commit b3f88ce

Browse files
committedOct 23, 2020
Add coverage report job.
1 parent ec53e23 commit b3f88ce

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed
 

‎.github/workflows/unit.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: unit
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- run: make unit
13+
- run: sed -i'' "s:^github.com/$GITHUB_REPOSITORY/::" coverage.out
14+
- uses: codecov/codecov-action@v1
15+
with:
16+
file: coverage.out
17+
fail_ci_if_error: true

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -461,3 +461,4 @@ pkg/apprclient/openapi/git_push.sh
461461
!pkg/**/testdata/**
462462
!test/**testdata/**
463463

464+
/coverage.out

‎Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static: build
4242

4343
.PHONY: unit
4444
unit:
45-
$(GO) test $(SPECIFIC_UNIT_TEST) $(TAGS) $(TEST_RACE) -count=1 -v ./pkg/...
45+
$(GO) test -coverprofile=coverage.out $(SPECIFIC_UNIT_TEST) $(TAGS) $(TEST_RACE) -count=1 -v ./pkg/...
4646

4747
.PHONY: sanity-check
4848
sanity-check:

0 commit comments

Comments
 (0)
Please sign in to comment.