|
16 | 16 | - disk=large |
17 | 17 | - extras=s3-cache |
18 | 18 | - tag=io-fuzz |
| 19 | + outputs: |
| 20 | + crashes_found: ${{ steps.check.outputs.crashes_found }} |
| 21 | + crash_count: ${{ steps.check.outputs.crash_count }} |
19 | 22 | steps: |
20 | 23 | - uses: runs-on/action@v2 |
21 | 24 | with: |
@@ -44,13 +47,36 @@ jobs: |
44 | 47 | AWS_ENDPOINT_URL: "https://01e9655179bbec953276890b183039bc.r2.cloudflarestorage.com" |
45 | 48 | - name: Run fuzzing target |
46 | 49 | 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 |
48 | 52 | 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 |
49 | 66 | - name: Archive crash artifacts |
| 67 | + if: steps.check.outputs.crashes_found == 'true' |
50 | 68 | uses: actions/upload-artifact@v4 |
51 | 69 | with: |
52 | 70 | name: io-fuzzing-crash-artifacts |
53 | 71 | 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 |
54 | 80 | - name: Persist corpus |
55 | 81 | shell: bash |
56 | 82 | run: | |
|
62 | 88 | AWS_REGION: "us-east-1" |
63 | 89 | AWS_ENDPOINT_URL: "https://01e9655179bbec953276890b183039bc.r2.cloudflarestorage.com" |
64 | 90 | - name: Fail job if fuzz run found a bug |
65 | | - if: steps.fuzz.outcome == 'failure' |
| 91 | + if: steps.check.outputs.crashes_found == 'true' |
66 | 92 | run: exit 1 |
67 | 93 |
|
| 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 | +
|
68 | 129 | ops_fuzz: |
69 | 130 | name: "Array Operations Fuzz" |
70 | 131 | timeout-minutes: 230 # almost 4 hours |
|
0 commit comments