name: Fuzz
on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
inputs:
duration:
description: "Fuzzing duration in seconds per target"
required: false
default: "300"
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
fuzz:
name: Fuzz ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- roundtrip
- sql_roundtrip
- apply_roundtrip
- reverse_idempotent
- differential
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
- name: Install cargo-fuzz
run: cargo install cargo-fuzz
- name: Cache cargo registry and build
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6
- name: Run fuzzer
run: |
DURATION="${{ github.event.inputs.duration || '300' }}"
cd fuzz
cargo fuzz run ${{ matrix.target }} -- -max_total_time=$DURATION
continue-on-error: true
- name: Upload crash artifacts
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with:
name: crash-${{ matrix.target }}
path: fuzz/artifacts/${{ matrix.target }}/
retention-days: 30