@@ -1189,7 +1189,7 @@ jobs:
1189
1189
command : |
1190
1190
apk update
1191
1191
# needed for grcov and compiling tests
1192
- apk add --no-cache mold clang curl llvm19-dev zlib-static clang19-static
1192
+ apk add --no-cache mold clang curl llvm19-dev zlib-static clang19-static lcov
1193
1193
- run :
1194
1194
name : Install cargo-llvm-cov and cargo-nextest
1195
1195
command : |
@@ -1212,19 +1212,46 @@ jobs:
1212
1212
- run :
1213
1213
name : Run tests with coverage
1214
1214
command : |
1215
- cargo llvm-cov --no-report nextest
1216
- cargo llvm-cov report --lcov --output-path lcov.info
1215
+ # Generate full coverage report
1216
+ cargo llvm-cov nextest --lcov --output-path lcov.info
1217
+
1218
+ # List of package directories and their flags
1219
+ set -- \
1220
+ "check:cosmwasm-check" \
1221
+ "core:cosmwasm-core" \
1222
+ "crypto:cosmwasm-crypto" \
1223
+ "derive:cosmwasm-derive" \
1224
+ "schema:cosmwasm-schema" \
1225
+ "schema-derive:cosmwasm-schema-derive" \
1226
+ "std:cosmwasm-std" \
1227
+ "vm:cosmwasm-vm" \
1228
+ "vm-derive:cosmwasm-vm-derive"
1229
+
1230
+ # Process each package-flag pair
1231
+ for entry in "$@"; do
1232
+ dir="${entry%%:*}"
1233
+ flag="${entry#*:}"
1234
+
1235
+ echo "Processing directory: $dir with flag: $flag"
1236
+
1237
+ # Extract coverage for specific directory using lcov
1238
+ lcov \
1239
+ --ignore-errors empty,unused \
1240
+ --extract lcov.info "packages/$dir/**/*" \
1241
+ --output-file "lcov-$dir.info"
1242
+
1243
+ # Upload filtered report
1244
+ ./codecov upload-coverage -t "$CODECOV_TOKEN" \
1245
+ --disable-search \
1246
+ --git-service github \
1247
+ --pr "${CIRCLE_PULL_REQUEST##*/}" \
1248
+ --branch "$CIRCLE_BRANCH" \
1249
+ --sha "$CIRCLE_SHA1" \
1250
+ -f "lcov-$dir.info" \
1251
+ -F "$flag"
1252
+ done
1217
1253
environment :
1218
1254
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
1228
1255
1229
1256
# This job roughly follows the instructions from https://circleci.com/blog/publishing-to-github-releases-via-circleci/
1230
1257
build_and_upload_devcontracts :
0 commit comments