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

Coverage experiments #2259

Closed
wants to merge 12 commits into from
58 changes: 23 additions & 35 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1086,10 +1086,9 @@ jobs:

coverage:
docker:
- image: rust:1.78.0-alpine3.19
- image: rust:1.78.0-alpine
environment:
# Limit the number of parallel jobs to avoid OOM crashes during doc testing
RUST_TEST_THREADS: 8
CARGO_TERM_COLOR: "always"
resource_class: medium+
steps:
- checkout
Expand All @@ -1098,47 +1097,36 @@ jobs:
command: |
apk update
apk add mold clang curl coreutils gnupg
#- restore_cache:
# keys:
# - cargocache-v2-coverage-rust:1.78-{{ checksum "Cargo.lock" }}
- run:
name: Install cargo-llvm-cov
command: |
cargo install cargo-llvm-cov --locked
- run:
name: Install grcov
name: Install cargo-nextest
command: |
rustup component add llvm-tools-preview
cargo install grcov --locked
cargo install cargo-nextest --locked
- run:
name: Run tests with coverage
command: |
mkdir -p reports
cargo test --all-features

grcov . -s packages/core --binary-path ./target/debug -t lcov -o ./reports/core.info
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/vm --binary-path ./target/debug -t lcov -o ./reports/vm.info
cargo llvm-cov nextest --features staking,iterator,stargate,dhat-heap,cosmwasm_2_2 --workspace --lcov --output-path lcov.info
environment:
RUSTFLAGS: "-Clinker=clang -Clink-arg=-fuse-ld=/usr/bin/mold -Cinstrument-coverage"
LLVM_PROFILE_FILE: "cosmwasm-%p-%m.profraw"
RUSTFLAGS: "-Clinker=clang -Clink-arg=-fuse-ld=/usr/bin/mold"
- run:
name: Quick fix for GPG error in Codecov
command: mkdir -p ~/.gnupg
- codecov/upload:
file: reports/core.info
flags: cosmwasm-core
- codecov/upload:
file: reports/crypto.info
flags: cosmwasm-crypto
- codecov/upload:
file: reports/derive.info
flags: cosmwasm-derive
- codecov/upload:
file: reports/schema.info
flags: cosmwasm-schema
- codecov/upload:
file: reports/std.info
flags: cosmwasm-std
- codecov/upload:
file: reports/vm.info
flags: cosmwasm-vm
- codecov/upload
- save_cache:
paths:
- /usr/local/cargo/registry
- ~/.cargo/bin/
- ~/.cargo/registry/index/
- ~/.cargo/registry/cache/
- ~/.cargo/git/db/
- target/
key: cargocache-v2-coverage-rust:1.78-{{ checksum "Cargo.lock" }}

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