Skip to content

Commit a153ea1

Browse files
authored
Merge pull request #44 from guyernest/fix/scheduled-fuzz-corpus
fix: handle missing corpus in scheduled fuzz coverage job
2 parents bd2bba7 + 15ec2a0 commit a153ea1

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/fuzz.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,31 @@ jobs:
8989
cargo install cargo-fuzz
9090
cargo install rustfilt
9191
92+
- name: Cache fuzz corpus
93+
uses: actions/cache@v4
94+
with:
95+
path: fuzz/corpus
96+
key: fuzz-corpus-all-${{ github.sha }}
97+
restore-keys: |
98+
fuzz-corpus-all-
99+
fuzz-corpus-
100+
101+
- name: Generate minimal corpus if needed
102+
run: |
103+
for target in protocol_parsing jsonrpc_handling transport_layer auth_flows; do
104+
# Create corpus directory if it doesn't exist
105+
mkdir -p fuzz/corpus/$target
106+
107+
# If corpus is empty, run fuzzer briefly to generate some inputs
108+
if [ -z "$(ls -A fuzz/corpus/$target 2>/dev/null)" ]; then
109+
echo "No corpus found for $target, generating minimal corpus..."
110+
cargo fuzz run $target -- \
111+
-max_total_time=10 \
112+
-print_final_stats=1 \
113+
-detect_leaks=0 || true
114+
fi
115+
done
116+
92117
- name: Generate coverage
93118
run: |
94119
for target in protocol_parsing jsonrpc_handling transport_layer auth_flows; do

0 commit comments

Comments
 (0)