Skip to content

Commit e195817

Browse files
committed
Fix coverage job
1 parent 961bdd8 commit e195817

File tree

2 files changed

+45
-44
lines changed

2 files changed

+45
-44
lines changed

.circleci/config.yml

+31-40
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
codecov: codecov/[email protected]
5-
win: circleci/[email protected]
4+
win: circleci/[email protected]
65

76
commands:
87
check_contract:
@@ -1182,58 +1181,50 @@ jobs:
11821181
coverage:
11831182
docker:
11841183
- image: rust:1.84.1-alpine3.21
1185-
environment:
1186-
# Limit the number of parallel jobs to avoid OOM crashes during doc testing
1187-
RUST_TEST_THREADS: 8
11881184
resource_class: medium+
11891185
steps:
11901186
- checkout
11911187
- run:
11921188
name: Install necessary packages
11931189
command: |
11941190
apk update
1195-
apk add mold clang curl coreutils gnupg llvm19-dev zlib-static clang19-static
1191+
# needed for grcov and compiling tests
1192+
apk add --no-cache mold clang curl llvm19-dev zlib-static clang19-static
11961193
- run:
1197-
name: Install grcov
1194+
name: Install cargo-llvm-cov and cargo-nextest
11981195
command: |
11991196
rustup component add llvm-tools-preview
1200-
cargo install grcov --locked
1197+
1198+
# cargo-nextest
1199+
curl -L --proto '=https' --tlsv1.2 -OsSf https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-0.9.92/cargo-nextest-0.9.92-x86_64-unknown-linux-musl.tar.gz
1200+
tar -xzf cargo-nextest-0.9.92-x86_64-unknown-linux-musl.tar.gz
1201+
mv cargo-nextest /usr/local/bin/
1202+
1203+
# cargo-llvm-cov
1204+
curl -L --proto '=https' --tlsv1.2 -OsSf https://github.com/taiki-e/cargo-llvm-cov/releases/download/v0.6.16/cargo-llvm-cov-x86_64-unknown-linux-musl.tar.gz
1205+
tar -xzf cargo-llvm-cov-x86_64-unknown-linux-musl.tar.gz
1206+
mv cargo-llvm-cov /usr/local/bin/
1207+
- run:
1208+
name: Install CodeCov CLI
1209+
command: |
1210+
curl -L --proto '=https' --tlsv1.2 -OsSf https://cli.codecov.io/v10.1.1/alpine/codecov
1211+
chmod +x codecov
12011212
- run:
12021213
name: Run tests with coverage
12031214
command: |
1204-
mkdir -p reports
1205-
cargo test --all-features
1206-
1207-
grcov . -s packages/core --binary-path ./target/debug -t lcov -o ./reports/core.info
1208-
grcov . -s packages/crypto --binary-path ./target/debug -t lcov -o ./reports/crypto.info
1209-
grcov . -s packages/derive --binary-path ./target/debug -t lcov -o ./reports/derive.info
1210-
grcov . -s packages/schema --binary-path ./target/debug -t lcov -o ./reports/schema.info
1211-
grcov . -s packages/std --binary-path ./target/debug -t lcov -o ./reports/std.info
1212-
grcov . -s packages/vm --binary-path ./target/debug -t lcov -o ./reports/vm.info
1215+
cargo llvm-cov --no-report nextest
1216+
cargo llvm-cov report --lcov --output-path lcov.info
12131217
environment:
1214-
RUSTFLAGS: "-Clinker=clang -Clink-arg=-fuse-ld=/usr/bin/mold -Cinstrument-coverage"
1215-
LLVM_PROFILE_FILE: "cosmwasm-%p-%m.profraw"
1216-
- run:
1217-
name: Quick fix for GPG error in Codecov
1218-
command: mkdir -p ~/.gnupg
1219-
- codecov/upload:
1220-
file: reports/core.info
1221-
flags: cosmwasm-core
1222-
- codecov/upload:
1223-
file: reports/crypto.info
1224-
flags: cosmwasm-crypto
1225-
- codecov/upload:
1226-
file: reports/derive.info
1227-
flags: cosmwasm-derive
1228-
- codecov/upload:
1229-
file: reports/schema.info
1230-
flags: cosmwasm-schema
1231-
- codecov/upload:
1232-
file: reports/std.info
1233-
flags: cosmwasm-std
1234-
- codecov/upload:
1235-
file: reports/vm.info
1236-
flags: cosmwasm-vm
1218+
RUSTFLAGS: "-Clinker=clang -Clink-arg=-fuse-ld=/usr/bin/mold"
1219+
- run:
1220+
name: Upload coverage to Codecov
1221+
command: |
1222+
./codecov upload-coverage -t "$CODECOV_TOKEN" \
1223+
--git-service github \
1224+
--pr ${CIRCLE_PULL_REQUEST##*/} \
1225+
--branch "$CIRCLE_BRANCH" \
1226+
--sha $CIRCLE_SHA1 \
1227+
-f lcov.info
12371228
12381229
# This job roughly follows the instructions from https://circleci.com/blog/publishing-to-github-releases-via-circleci/
12391230
build_and_upload_devcontracts:

codecov.yml

+14-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ coverage:
99
default:
1010
threshold: 0.05%
1111

12-
ignore:
13-
- "contracts"
14-
# Disabled due to "cargo_tarpaulin: Failed to get test coverage! Error: Failed to run tests: Error running test - SIGILL raised in 5835"
15-
- "packages/vm"
12+
fixes:
13+
- "/root/project/::" # reduce root, e.g. "/root/project/path/" => "path/"
1614

1715
flags:
16+
cosmwasm-check:
17+
paths:
18+
- packages/check/
19+
cosmwasm-core:
20+
paths:
21+
- packages/core/
1822
cosmwasm-crypto:
1923
paths:
2024
- packages/crypto/
@@ -30,3 +34,9 @@ flags:
3034
cosmwasm-std:
3135
paths:
3236
- packages/std/
37+
cosmwasm-vm:
38+
paths:
39+
- packages/vm/
40+
cosmwasm-vm-derive:
41+
paths:
42+
- packages/vm-derive/

0 commit comments

Comments
 (0)