From 0c241707bdc6aeb7efffbc892b91369172d4d4bb Mon Sep 17 00:00:00 2001 From: Yellow Shine Date: Mon, 21 Oct 2024 19:06:45 +0800 Subject: [PATCH] enhance: [codecov]split code coverage into components Signed-off-by: Yellow Shine --- .github/workflows/main.yaml | 27 ++++++++++----------------- ci/jenkins/UT-CPP.groovy | 2 +- codecov.yml | 32 +++++++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 91f1233976a2c..19bda9b78975f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -289,23 +289,16 @@ jobs: - name: Display structure of code coverage results run: | ls -lah - - name: Upload coverage to Codecov + - name: Upload coverage reports to Codecov if: ${{ github.repository == 'milvus-io/milvus' }} - uses: codecov/codecov-action@v4 - id: upload_cov - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./go_coverage.txt,./it_coverage.txt - name: ubuntu-20.04-unittests - fail_ci_if_error: true - disable_safe_directory: true + run: | + curl -Os https://cli.codecov.io/latest/linux/codecov + chmod +x codecov + ./codecov --verbose upload-process --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} -n 'github-actions' -f './go_coverage.txt' -f './it_coverage.txt' + - name: Retry Upload coverage to Codecov if: ${{ failure() && github.repository == 'milvus-io/milvus' }} - uses: codecov/codecov-action@v4 - id: retry_upload_cov - with: - token: ${{ secrets.CODECOV_TOKEN }} - files: ./go_coverage.txt,./it_coverage.txt - name: ubuntu-20.04-unittests - fail_ci_if_error: true - disable_safe_directory: true + run: | + ./codecov --verbose upload-process --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} -n 'github-actions' -f './go_coverage.txt' -f './it_coverage.txt' + + diff --git a/ci/jenkins/UT-CPP.groovy b/ci/jenkins/UT-CPP.groovy index c0818c4596621..9b776753fdf1f 100644 --- a/ci/jenkins/UT-CPP.groovy +++ b/ci/jenkins/UT-CPP.groovy @@ -40,7 +40,7 @@ pipeline { pullRequestNumber: "$env.CHANGE_ID", make_cmd: "make clean && make USE_ASAN=ON build-cpp-with-coverage", test_entrypoint: "./scripts/run_cpp_codecov.sh", - codecov_files: "./lcov_output.info,./it_coverage.txt" + codecov_files: "./lcov_output.info" } } } diff --git a/codecov.yml b/codecov.yml index 8d039a792ede2..5ecb725f82b54 100644 --- a/codecov.yml +++ b/codecov.yml @@ -23,11 +23,40 @@ coverage: if_ci_failed: error #success, failure, error, ignore comment: - layout: "reach, diff, flags, files" + layout: "reach, diff, flags, components, files" behavior: default require_changes: false branches: # branch names that can post comment - master + +component_management: + default_rules: # default rules that will be inherited by all components + statuses: + - type: project # in this case every component that doens't have a status defined will have a project type one + target: auto + branches: + - "!main" + + individual_components: + - component_id: client + name: client + paths: + - client/** + - component_id: core + name: core + paths: + - internal/core/** + - component_id: cpp + name: cpp + paths: + - "**/*.c" + - "**/*.cpp" + - "**/*.h" + - component_id: go + name: go + paths: + - "**/*.go" # Includes all Go source files + - "!client/**" # Excludes the client component ignore: - "LICENSES" @@ -42,3 +71,4 @@ ignore: +