Skip to content

Commit 9050f12

Browse files
committed
create new fuzz script and add to coverage job
1 parent a460b7a commit 9050f12

File tree

3 files changed

+23
-25
lines changed

3 files changed

+23
-25
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ jobs:
126126
# Could you use this to fake the coverage report for your PR? Sure.
127127
# Will anyone be impressed by your amazing coverage? No
128128
# Maybe if codecov wasn't broken we wouldn't need to do this...
129+
./ci/ci-fuzz.sh
129130
bash <(curl -s https://codecov.io/bash) -f target/codecov.json -t "f421b687-4dc2-4387-ac3d-dc3b2528af57"
130131
131132
benchmark:

ci/ci-fuzz.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -eox pipefail
3+
4+
echo -e "\n\nGenerating fuzz coverage report"
5+
# In CI, store coverage in a specific directory for artifact collection
6+
COVERAGE_DIR="coverage-report"
7+
mkdir -p "$COVERAGE_DIR"
8+
echo "Installing cargo-llvm-cov..."
9+
# Install cargo-llvm-cov if not already installed
10+
cargo install cargo-llvm-cov --locked
11+
echo "Running fuzz coverage generation..."
12+
./contrib/generate_fuzz_coverage.sh --output-dir "$COVERAGE_DIR"
13+
echo "Coverage generation completed. Checking results..."
14+
if [ -f "fuzz/$COVERAGE_DIR/html/index.html" ]; then
15+
echo "✓ Coverage report successfully generated at fuzz/$COVERAGE_DIR/html/index.html"
16+
ls -la "fuzz/$COVERAGE_DIR/html/"
17+
else
18+
echo "✗ Coverage report not found at expected location"
19+
echo "Checking what was created in fuzz/$COVERAGE_DIR:"
20+
ls -la "fuzz/$COVERAGE_DIR" || echo "Directory does not exist"
21+
fi
22+

ci/ci-tests.sh

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -137,28 +137,3 @@ RUSTFLAGS="--cfg=splicing" cargo test --verbose --color always -p lightning
137137
RUSTFLAGS="--cfg=async_payments" cargo test --verbose --color always -p lightning
138138
[ "$CI_MINIMIZE_DISK_USAGE" != "" ] && cargo clean
139139
RUSTFLAGS="--cfg=lsps1_service" cargo test --verbose --color always -p lightning-liquidity
140-
141-
# Generate fuzz coverage report
142-
echo -e "\n\nGenerating fuzz coverage report"
143-
if [ -n "$CI" ]; then
144-
# In CI, store coverage in a specific directory for artifact collection
145-
COVERAGE_DIR="coverage-report"
146-
mkdir -p "$COVERAGE_DIR"
147-
echo "Installing cargo-llvm-cov..."
148-
# Install cargo-llvm-cov if not already installed
149-
cargo install cargo-llvm-cov --locked
150-
echo "Running fuzz coverage generation..."
151-
./contrib/generate_fuzz_coverage.sh --output-dir "$COVERAGE_DIR"
152-
echo "Coverage generation completed. Checking results..."
153-
if [ -f "fuzz/$COVERAGE_DIR/html/index.html" ]; then
154-
echo "✓ Coverage report successfully generated at fuzz/$COVERAGE_DIR/html/index.html"
155-
ls -la "fuzz/$COVERAGE_DIR/html/"
156-
else
157-
echo "✗ Coverage report not found at expected location"
158-
echo "Checking what was created in fuzz/$COVERAGE_DIR:"
159-
ls -la "fuzz/$COVERAGE_DIR" || echo "Directory does not exist"
160-
fi
161-
else
162-
# Local development
163-
./contrib/generate_fuzz_coverage.sh
164-
fi

0 commit comments

Comments
 (0)