Skip to content

Commit 3a06737

Browse files
committed
test log logs
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 32d0834 commit 3a06737

File tree

1 file changed

+63
-2
lines changed

1 file changed

+63
-2
lines changed

.github/workflows/fuzz.yml

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616
- disk=large
1717
- extras=s3-cache
1818
- tag=io-fuzz
19+
outputs:
20+
crashes_found: ${{ steps.check.outputs.crashes_found }}
21+
crash_count: ${{ steps.check.outputs.crash_count }}
1922
steps:
2023
- uses: runs-on/action@v2
2124
with:
@@ -44,13 +47,36 @@ jobs:
4447
AWS_ENDPOINT_URL: "https://01e9655179bbec953276890b183039bc.r2.cloudflarestorage.com"
4548
- name: Run fuzzing target
4649
id: fuzz
47-
run: RUST_BACKTRACE=1 cargo +nightly fuzz run --release --debug-assertions file_io -- -max_total_time=7200
50+
run: |
51+
RUST_BACKTRACE=1 cargo +nightly fuzz run --release --debug-assertions file_io -- -max_total_time=7200 2>&1 | tee fuzz_output.log
4852
continue-on-error: true
53+
- name: Check for crashes
54+
id: check
55+
run: |
56+
if [ -d "fuzz/artifacts" ] && [ "$(ls -A fuzz/artifacts 2>/dev/null)" ]; then
57+
echo "crashes_found=true" >> $GITHUB_OUTPUT
58+
CRASH_COUNT=$(find fuzz/artifacts -type f \( -name "crash-*" -o -name "leak-*" -o -name "timeout-*" -o -name "oom-*" \) | wc -l)
59+
echo "crash_count=$CRASH_COUNT" >> $GITHUB_OUTPUT
60+
echo "Found $CRASH_COUNT crash(es)"
61+
else
62+
echo "crashes_found=false" >> $GITHUB_OUTPUT
63+
echo "crash_count=0" >> $GITHUB_OUTPUT
64+
echo "No crashes found"
65+
fi
4966
- name: Archive crash artifacts
67+
if: steps.check.outputs.crashes_found == 'true'
5068
uses: actions/upload-artifact@v4
5169
with:
5270
name: io-fuzzing-crash-artifacts
5371
path: fuzz/artifacts
72+
retention-days: 30
73+
- name: Archive fuzzer output log
74+
if: steps.check.outputs.crashes_found == 'true'
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: io-fuzzing-logs
78+
path: fuzz_output.log
79+
retention-days: 30
5480
- name: Persist corpus
5581
shell: bash
5682
run: |
@@ -62,9 +88,44 @@ jobs:
6288
AWS_REGION: "us-east-1"
6389
AWS_ENDPOINT_URL: "https://01e9655179bbec953276890b183039bc.r2.cloudflarestorage.com"
6490
- name: Fail job if fuzz run found a bug
65-
if: steps.fuzz.outcome == 'failure'
91+
if: steps.check.outputs.crashes_found == 'true'
6692
run: exit 1
6793

94+
report-io-fuzz-failures:
95+
name: "Report IO Fuzz Failures"
96+
needs: io_fuzz
97+
if: always() && needs.io_fuzz.outputs.crashes_found == 'true'
98+
runs-on: ubuntu-latest
99+
permissions:
100+
issues: write
101+
contents: read
102+
steps:
103+
- name: Checkout repository
104+
uses: actions/checkout@v5
105+
106+
- name: Download crash artifacts
107+
uses: actions/download-artifact@v4
108+
with:
109+
name: io-fuzzing-crash-artifacts
110+
path: ./crash_artifacts
111+
112+
- name: Download fuzzer logs
113+
uses: actions/download-artifact@v4
114+
with:
115+
name: io-fuzzing-logs
116+
path: ./logs
117+
118+
- name: List downloaded files
119+
run: |
120+
echo "=== Crash Artifacts ==="
121+
ls -lah crash_artifacts/ || echo "No crash artifacts"
122+
echo ""
123+
echo "=== Fuzzer Logs ==="
124+
ls -lah logs/ || echo "No logs"
125+
echo ""
126+
echo "=== Log preview (first 50 lines) ==="
127+
head -50 logs/fuzz_output.log || echo "No log file"
128+
68129
ops_fuzz:
69130
name: "Array Operations Fuzz"
70131
timeout-minutes: 230 # almost 4 hours

0 commit comments

Comments
 (0)