22set -eox pipefail
33
44echo -e " \n\nGenerating fuzz coverage report"
5- # In CI, store coverage in a specific directory for artifact collection
6- COVERAGE_DIR=" coverage-report"
5+ # In CI, store coverage in target directory for consistency with other artifacts
6+ COVERAGE_DIR=" target/ coverage-report"
77echo " Installing cargo-llvm-cov..."
88# Install cargo-llvm-cov if not already installed
99cargo install cargo-llvm-cov --locked
10+
11+ # Clean up disk space if needed
12+ if [ " $CI_MINIMIZE_DISK_USAGE " != " " ]; then
13+ echo " Cleaning up to save disk space..."
14+ rm -rf target/debug/incremental/
15+ rm -rf target/debug/.fingerprint/
16+ # Remove previous coverage reports if they exist
17+ rm -rf target/coverage-report/
18+ rm -rf fuzz/coverage-report/
19+ # Clean release artifacts but keep debug for current run
20+ cargo clean --release
21+ echo " Disk cleanup completed"
22+ fi
23+
1024echo " Running fuzz coverage generation..."
1125./contrib/generate_fuzz_coverage.sh --output-dir " $COVERAGE_DIR "
1226echo " Coverage generation completed. Checking results..."
13- if [ -f " fuzz/ $COVERAGE_DIR /html/index.html " ] ; then
14- echo " ✓ Coverage report successfully generated at fuzz/ $COVERAGE_DIR /html/index.html "
15- ls -la " fuzz/ $COVERAGE_DIR /html/ "
16- else
17- echo " ✗ Coverage report not found at expected location "
18- fi
27+
28+ # Upload fuzz coverage to codecov if the file exists (CI only)
29+ if [ -f " $COVERAGE_DIR /fuzz-codecov.json " ] ; then
30+ echo " Uploading fuzz coverage to codecov... "
31+ bash <( curl -s https://codecov.io/bash ) -f " $COVERAGE_DIR /fuzz-codecov.json " -F fuzz -t " f421b687-4dc2-4387-ac3d-dc3b2528af57 "
32+ fi
0 commit comments