From d90e024653addc5fc77ca2cb351e3791e8100faa Mon Sep 17 00:00:00 2001 From: Wenqi Qiu Date: Tue, 30 Aug 2022 15:35:13 +0800 Subject: [PATCH] Add codecov setting for test coverge check Signed-off-by: Wenqi Qiu --- .github/workflows/go.yml | 7 +++++++ Makefile | 2 +- codecov.yaml | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 codecov.yaml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index e71ab9e8..82a70657 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -47,6 +47,13 @@ jobs: - name: Run integration tests run: | make docker-test-integration + - name: Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: cover.out + flags: unit-tests + name: codecov-unit-test tidy: runs-on: [ubuntu-latest] diff --git a/Makefile b/Makefile index 8a3b04dd..0d7e8fe2 100755 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ test-integration: @echo @echo "==> Running integration tests <==" @echo "SOME TESTS WILL FAIL IF NOT RUN AS ROOT!" - $(GO) test antrea.io/ofnet/ofctrl/... + $(GO) test antrea.io/ofnet/ofctrl/... -v -coverprofile cover.out .PHONY: docker-test-integration docker-test-integration: diff --git a/codecov.yaml b/codecov.yaml new file mode 100644 index 00000000..96e4e9d8 --- /dev/null +++ b/codecov.yaml @@ -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"