Skip to content

Commit

Permalink
cargo-llvm-cov + caching
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra committed Sep 18, 2024
1 parent 0580b99 commit a9b1e37
Showing 1 changed file with 17 additions and 30 deletions.
47 changes: 17 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1098,47 +1098,34 @@ jobs:
command: |
apk update
apk add mold clang curl coreutils gnupg
- restore_cache:
keys:
- cargocache-v2-coverage-rust:1.74-{{ checksum "Cargo.lock" }}
- run:
name: Install grcov
name: Install cargo-llvm-cov
command: |
rustup component add llvm-tools-preview
cargo install grcov --locked
cargo install cargo-llvm-cov --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 --all-features --workspace --codecov --output-path codecov.json
environment:
RUSTFLAGS: "-Clinker=clang -Clink-arg=-fuse-ld=/usr/bin/mold -Cinstrument-coverage"
RUSTFLAGS: "-Clinker=clang -Clink-arg=-fuse-ld=/usr/bin/mold"
LLVM_PROFILE_FILE: "cosmwasm-%p-%m.profraw"
- 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
file: codecov.json
- 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

0 comments on commit a9b1e37

Please sign in to comment.