Skip to content

Commit

Permalink
Add codecov
Browse files Browse the repository at this point in the history
Signed-off-by: Wenqi Qiu <[email protected]>
  • Loading branch information
wenqiq committed Sep 4, 2024
1 parent e3898b6 commit df20dab
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ jobs:

- name: Run test
run: make test

- name: Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./.coverage/coverage-unit.out
flags: unit-tests
name: codecov-unit-test
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ golangci-fix: $(GOLANGCI_LINT_BIN)

.PHONY: test
test: manifests generate fmt vet envtest .coverage ## Run tests .
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test -gcflags=all=-l ./... -coverprofile $(CURDIR)/.coverage/coverage-unit.out ## Prohibit inline optimization when using gomonkey
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test -gcflags=all=-l ./... -v -coverprofile $(CURDIR)/.coverage/coverage-unit.out ## Prohibit inline optimization when using gomonkey

##@ Build

Expand Down
35 changes: 35 additions & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
codecov:
branch: main
require_ci_to_pass: no

comment:
layout: "reach,diff,flags,tree"
behavior: default
require_changes: no
require_base: no
require_head: no
after_n_builds: 1
show_carryforward_flags: true

github_checks:
annotations: true

coverage:
status:
patch:
default:
target: 70%
threshold: 5%
base: auto
only_pulls: false
project:
default:
target: auto
threshold: 0.3%

flag_management:
default_rules:
carryforward: true

ignore:
- "**/testing/*.go"

0 comments on commit df20dab

Please sign in to comment.