Skip to content

Commit

Permalink
add coverage badge (#120)
Browse files Browse the repository at this point in the history
* add coverage badge

* fix typo error
  • Loading branch information
qishipengqsp authored Nov 24, 2022
1 parent f204ccd commit 3be3e88
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ jobs:
context: .
load: true
tags: ${{ env.TEST_TAG }}
secrets: |
"CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}"
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# TuGraph

![Build Status](https://github.com/Tugraph-db/Tugraph-db/actions/workflows/ci.yml/badge.svg)
![Coverage Badge](https://codecov.io/github/TuGraph-db/tugraph-db/branch/master/graph/badge.svg)

## 0. Introduction
TuGraph is an efficient graph database that supports high data volume, low latency lookup and fast graph analytics.
Expand Down
2 changes: 1 addition & 1 deletion ci/ci_cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ pytest ./
# codecov
cd $WORKSPACE
mkdir testresult
bash ./ci/codecov.sh build $WORKSPACE/testresult
bash ./ci/codecov.sh build $WORKSPACE/testresult $CODECOV_TOKEN

python3 ./ci/lcov_cobertura.py $WORKSPACE/testresult/coverage.info --output $WORKSPACE/testresult/coverage.xml --demangle
3 changes: 3 additions & 0 deletions ci/codecov.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ lcov --remove $2/coverage.info '*/include/libcuckoo/*' --output-file $2/coverage
lcov --remove $2/coverage.info '*/src/cypher/parser/*' --output-file $2/coverage.info # filter out system
lcov --remove $2/coverage.info '*/include/tools/json.hpp' --output-file $2/coverage.info # filter out system
# lcov --list $2/coverage.info #debug info

# Uploading report to CodeCov
bash <(curl -s https://codecov.io/bash) -f $2/coverage.info -t $3 || echo "Codecov did not collect coverage reports"
4 changes: 3 additions & 1 deletion ci/gh-actions/ubuntu-latest/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ ENV WORKSPACE=/root/tugraph-db/
COPY . /root/tugraph-db/
WORKDIR /root/tugraph-db/

RUN bash /root/tugraph-db/ci/ci_cmd.sh
RUN --mount=type=secret,id=CODECOV_TOKEN \
export CODECOV_TOKEN=$(cat /run/secrets/CODECOV_TOKEN) && \
bash /root/tugraph-db/ci/ci_cmd.sh

0 comments on commit 3be3e88

Please sign in to comment.