Skip to content

Commit

Permalink
enhance: [codecov]split code coverage into components
Browse files Browse the repository at this point in the history
Signed-off-by: Yellow Shine <[email protected]>
  • Loading branch information
yellow-shine committed Oct 23, 2024
1 parent 1d61b60 commit 37166fb
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 19 deletions.
27 changes: 10 additions & 17 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion ci/jenkins/UT-CPP.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down
32 changes: 31 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -42,3 +71,4 @@ ignore:




0 comments on commit 37166fb

Please sign in to comment.