From 72dfb506d95b1da6dbc4b975bb8e180b4dce175b Mon Sep 17 00:00:00 2001 From: Young Bu Park Date: Mon, 1 Apr 2024 17:57:35 -0700 Subject: [PATCH] Run codecov action only once (#7427) --- .codecov.yml | 20 ++++++++++++++++++++ .github/workflows/build.yaml | 9 ++++++--- codecov.yml | 22 ---------------------- 3 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 .codecov.yml delete mode 100644 codecov.yml diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 0000000000..69e4c87f35 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,20 @@ +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "30...100" + status: + project: + default: + informational: true + target: auto + threshold: 0% + +ignore: + - "**/mock_*.go" # ignore all mock files + - "pkg/armrpc/rpctest" # ignore all test helpers in rpctest + - "**/zz_generated*.go" # ignore autogenerated files from autorest + - "pkg/controller/api" # CRD related files + - "pkg/ucp/store/apiserverstore/api" # CRD related files \ No newline at end of file diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5d659d6890..7877ce6491 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -102,11 +102,14 @@ jobs: go install gotest.tools/gotestsum@v${{ env.GOTESTSUMVERSION }} make test - name: Upload coverage to Codecov - uses: codecov/codecov-action@v3 + if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux' + uses: codecov/codecov-action@v4 with: + token: ${{ secrets.CODECOV_TOKEN }} + codecov_yml_path: ./.codecov.yml file: ./dist/unit_test/ut_coverage.out - flags: unittests - fail_ci_if_error: false + fail_ci_if_error: true + verbose: true - name: Process Unit Test Results uses: ./.github/actions/process-test-results # Always is required here to make sure this target runs even when tests fail. diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index b14376cfa1..0000000000 --- a/codecov.yml +++ /dev/null @@ -1,22 +0,0 @@ -codecov: - require_ci_to_pass: yes - -coverage: - precision: 2 - round: down - range: "50...100" - status: - project: - default: - target: auto - threshold: 1% - -comment: - layout: "reach,diff,flags,tree" - behavior: default - require_changes: no - -ignore: - - "**/mock_*" # ignore all mock files - - "pkg/armrpc/rpctest/*" # ignore all test helpers in rpctest - - "**/zz_*" # ignore autogenerated files from autorest