Skip to content

Commit

Permalink
Merge pull request #134 from line/codecov
Browse files Browse the repository at this point in the history
feat: Integrate a codecov with this repository
  • Loading branch information
tnasu authored Dec 24, 2020
2 parents 034541a + 092ae71 commit a01efd2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ jobs:
mkdir -p /tmp/logs /tmp/workspace/profiles
for pkg in $(go list github.com/tendermint/tendermint/... | circleci tests split --split-by=timings); do
id=$(basename "$pkg")
go test -v -timeout 5m -mod=readonly -race -coverprofile=/tmp/workspace/profiles/$id.out -covermode=atomic "$pkg" | tee "/tmp/logs/$id-$RANDOM.log"
prefix=$(basename ${pkg%$id})
go test -v -timeout 5m -mod=readonly -race -coverprofile=/tmp/workspace/profiles/$prefix-$id.out -covermode=atomic "$pkg" | tee "/tmp/logs/$id-$RANDOM.log"
done
- persist_to_workspace:
root: /tmp/workspace
Expand Down Expand Up @@ -180,6 +181,31 @@ jobs:
- store_artifacts:
path: /home/circleci/project/test/p2p/logs

upload_coverage:
executor: golang
steps:
- attach_workspace:
at: /tmp/workspace
- restore_cache:
name: "Restore source code cache"
keys:
- go-src-v1-{{ .Revision }}
- checkout
- restore_cache:
name: "Restore go module cache"
keys:
- go-mod-v2-{{ checksum "go.sum" }}
- run:
name: gather
command: |
echo "mode: atomic" > coverage.txt
for prof in $(ls /tmp/workspace/profiles/); do
tail -n +2 /tmp/workspace/profiles/"$prof" >> coverage.txt
done
- run:
name: upload
command: bash .circleci/codecov.sh -f coverage.txt

deploy_docs:
executor: docs
steps:
Expand Down Expand Up @@ -410,6 +436,9 @@ workflows:
- test_p2p:
name: test_p2p_ipv6
ipv: 6
- upload_coverage:
requires:
- test_cover
- reproducible_builds:
filters:
branches:
Expand Down
4 changes: 4 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
codecov:
token: a0d06f00-e140-4525-93f9-1722b2c9d5d2

coverage:
precision: 2
round: down
Expand All @@ -6,6 +9,7 @@ coverage:
status:
project:
default:
target : 0%
threshold: 1%
patch: on
changes: off
Expand Down

0 comments on commit a01efd2

Please sign in to comment.