name: Fuzz
on:
workflow_dispatch:
inputs:
max_total_time:
description: "Seconds to run each fuzz target"
required: false
default: "120"
schedule:
- cron: "0 6 * * 1"
env:
CARGO_TERM_COLOR: always
jobs:
fuzz:
name: Fuzz targets
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- parameters_validate
- logentry_deserialize
- chain_validate
- proof_verify
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: sudo apt-get update && sudo apt-get install -y libdbus-1-dev pkg-config
- uses: Swatinem/rust-cache@v2
with:
workspaces: fuzz
- run: cargo install cargo-fuzz
- name: Run ${{ matrix.target }}
working-directory: fuzz
run: >-
cargo +nightly fuzz run ${{ matrix.target }}
-- -max_total_time=${{ github.event.inputs.max_total_time || '120' }}
- name: Upload crash artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: fuzz-artifacts-${{ matrix.target }}
path: fuzz/artifacts/
if-no-files-found: ignore