Skip to content

Commit

Permalink
Merge pull request #537 from LiZhenCheng9527/codecov
Browse files Browse the repository at this point in the history
add codecov config
  • Loading branch information
kmesh-bot authored Jul 10, 2024
2 parents 7a34200 + 548ebc1 commit 9c3c136
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
11 changes: 11 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
coverage:
status:
project: #add everything under here, more options at https://docs.codecov.com/docs/commit-status
default:
# basic
target: auto #default
threshold: 50%
base: auto
comment: # this is a top-level key
layout: "header, files, footer" # remove "new" from "header" and "footer"
hide_project_coverage: false # set to false
18 changes: 13 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Kmesh CI Workflow
on:
pull_request:
merge_group: # enable merge queue
workflow_call:
secrets:
CODECOV_TOKEN:
required: true

jobs:

Expand Down Expand Up @@ -45,9 +49,13 @@ jobs:
sudo env LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:$GITHUB_WORKSPACE/api/v2-c:$GITHUB_WORKSPACE/bpf/deserialization_to_bpf_map PKG_CONFIG_PATH=$GITHUB_WORKSPACE/mk go test -race -v -vet=off -coverprofile=coverage.out ./pkg/...
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.out
flags: unittests
fail_ci_if_error: false
# Even though token upload token is not required for public repos,
# but adding a token might increase successful uploads as per:
# https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out
flags: unittests
fail_ci_if_error: false
verbose: true

0 comments on commit 9c3c136

Please sign in to comment.