Add: codecov configuration. (#166)

Signed-off-by: xuezhaojun <zxue@redhat.com>
This commit is contained in:
xuezhaojun
2023-06-06 16:22:08 +08:00
committed by GitHub
parent fed5020c12
commit 652bf923f4
3 changed files with 20 additions and 0 deletions

10
.codecov.yml Normal file
View File

@@ -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"

View File

@@ -68,6 +68,15 @@ jobs:
go-version: ${{ env.GO_VERSION }}
- name: unit
run: make test
- name: report coverage
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_UPLOAD_TOKEN }}
files: ./coverage.out
flags: unit
name: unit
verbose: true
fail_ci_if_error: true
integration:
name: integration

View File

@@ -25,6 +25,7 @@ endif
# Add packages to do unit test
GO_TEST_PACKAGES :=./pkg/...
GO_TEST_FLAGS := -race -coverprofile=coverage.out
IMAGE_REGISTRY?=quay.io/open-cluster-management
IMAGE_TAG?=latest