Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace tarpaulin with grcov #1888

Merged
merged 6 commits into from
Sep 27, 2023
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 29 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
codecov: codecov/codecov@3.2.0
codecov: codecov/codecov@3.2.5
win: circleci/windows@5.0

commands:
Expand Down Expand Up @@ -86,7 +86,7 @@ workflows:
# Add your branch here if benchmarking matters to your work
- fix-benchmarking
- w3
# - coverage # disabled temporarily because Rust version is too low
- coverage
deploy:
jobs:
- build_and_upload_devcontracts:
Expand Down Expand Up @@ -967,42 +967,48 @@ jobs:

coverage:
# https://circleci.com/developer/images?imageType=machine
machine:
image: ubuntu-2004:202201-02
docker:
- image: rust:1.72.0
chipshort marked this conversation as resolved.
Show resolved Hide resolved
steps:
- checkout
- run:
name: Install grcov
command: |
rustup component add llvm-tools-preview
cargo install grcov --locked
- run:
name: Run tests with coverage
# See https://github.com/xd009642/tarpaulin/blob/develop/CHANGELOG.md and https://hub.docker.com/r/xd009642/tarpaulin/tags
# for tarpaulin versions.
command: |
mkdir -p reports/crypto
mkdir -p reports/derive
mkdir -p reports/schema
mkdir -p reports/std
mkdir -p reports/storage
CRYPTO=" cargo tarpaulin --skip-clean --out Xml --output-dir reports/crypto --packages cosmwasm-crypto"
DERIVE=" cargo tarpaulin --skip-clean --out Xml --output-dir reports/derive --packages cosmwasm-derive"
SCHEMA=" cargo tarpaulin --skip-clean --out Xml --output-dir reports/schema --packages cosmwasm-schema"
STD=" cargo tarpaulin --skip-clean --out Xml --output-dir reports/std --packages cosmwasm-std --features abort,iterator,staking,stargate,cosmwasm_1_4"
STORAGE="cargo tarpaulin --skip-clean --out Xml --output-dir reports/storage --packages cosmwasm-storage"
docker run --security-opt seccomp=unconfined -v "${PWD}:/volume" xd009642/tarpaulin:0.21.0 \
sh -c "$CRYPTO && $DERIVE && $SCHEMA && $STD && $STORAGE"
mkdir -p reports
cargo test

grcov . -s packages/crypto --binary-path ./target/debug -t lcov -o ./reports/crypto.info
grcov . -s packages/derive --binary-path ./target/debug -t lcov -o ./reports/derive.info
grcov . -s packages/schema --binary-path ./target/debug -t lcov -o ./reports/schema.info
grcov . -s packages/std --binary-path ./target/debug -t lcov -o ./reports/std.info
grcov . -s packages/storage --binary-path ./target/debug -t lcov -o ./reports/storage.info
grcov . -s packages/vm --binary-path ./target/debug -t lcov -o ./reports/vm.info
environment:
RUSTFLAGS: "-Cinstrument-coverage"
LLVM_PROFILE_FILE: "cosmwasm-%p-%m.profraw"
- codecov/upload:
file: reports/crypto/cobertura.xml
file: reports/crypto.info
flags: cosmwasm-crypto
- codecov/upload:
file: reports/derive/cobertura.xml
file: reports/derive.info
flags: cosmwasm-derive
- codecov/upload:
file: reports/schema/cobertura.xml
file: reports/schema.info
flags: cosmwasm-schema
- codecov/upload:
file: reports/std/cobertura.xml
file: reports/std.info
flags: cosmwasm-std
- codecov/upload:
file: reports/storage/cobertura.xml
file: reports/storage.info
flags: cosmwasm-storage
- codecov/upload:
file: reports/vm.info
flags: cosmwasm-vm

# This job roughly follows the instructions from https://circleci.com/blog/publishing-to-github-releases-via-circleci/
build_and_upload_devcontracts:
Expand Down
Loading