Skip to content

Commit

Permalink
Add code coverage check (#74)
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Ng <[email protected]>
  • Loading branch information
mikeshng authored Jun 6, 2023
1 parent f8b86a5 commit 93b4dc8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
coverage:
status:
patch: off # disable patch status, https://docs.codecov.com/docs/commit-status#patch-status
project:
default:
target: auto
threshold: 1%

ignore:
- "**/*generated*.go"
9 changes: 9 additions & 0 deletions .github/workflows/go-presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ jobs:
run: make test
env:
KUBECONFIG: /home/runner/.kube/config
- name: report-coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
files: /home/runner/work/multicloud-operators-channel/multicloud-operators-channel/go/src/open-cluster-management.io/multicloud-operators-channel/coverage.out
flags: unit
name: unit
verbose: true
fail_ci_if_error: true

go-sec-scan:
name: go-sec-scan
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ endif
.PHONY: ensure-kubebuilder-tools

test: ensure-kubebuilder-tools
go test -timeout 300s -v ./pkg/...
go test -timeout 300s -v ./pkg/... -race -coverprofile=coverage.out

0 comments on commit 93b4dc8

Please sign in to comment.