diff --git a/.circleci/config.yml b/.circleci/config.yml index ead4cd72b..1e7d99ea4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -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 @@ -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: @@ -410,6 +436,9 @@ workflows: - test_p2p: name: test_p2p_ipv6 ipv: 6 + - upload_coverage: + requires: + - test_cover - reproducible_builds: filters: branches: diff --git a/codecov.yml b/codecov.yml index 4b3d527fa..7491d9520 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,6 @@ +codecov: + token: a0d06f00-e140-4525-93f9-1722b2c9d5d2 + coverage: precision: 2 round: down @@ -6,6 +9,7 @@ coverage: status: project: default: + target : 0% threshold: 1% patch: on changes: off