name: Fuzz
on:
schedule:
- cron: '0 3 * * *' workflow_dispatch:
inputs:
max_total_time:
description: 'Max fuzzing time per target, in seconds'
default: '600'
defaults:
run: { shell: bash }
concurrency:
group: fuzz-${{ github.ref }}
cancel-in-progress: true
jobs:
fuzz:
name: Fuzz ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [slice_equivalence, polygon_equivalence, point_equivalence]
timeout-minutes: 30
env:
CARGO_BUILD_WARNINGS: warn
steps:
- uses: actions/checkout@v7
- name: Install nightly Rust (cargo-fuzz needs it)
uses: dtolnay/rust-toolchain@stable
with: { toolchain: nightly }
- uses: taiki-e/install-action@v2.87.23
with: { tool: 'just,cargo-binstall' }
- name: Cache fuzz corpus
uses: actions/cache@v6
with:
path: fuzz/corpus
key: fuzz-corpus-${{ matrix.target }}-${{ github.run_id }}
restore-keys: fuzz-corpus-${{ matrix.target }}-
- name: Fuzz for the configured time (fails on any crash/assertion)
run: just fuzz ${{ matrix.target }} -- -max_total_time=${{ github.event.inputs.max_total_time || '600' }}
- name: Upload crash reproducers
if: failure()
uses: actions/upload-artifact@v7
with:
name: fuzz-artifacts-${{ matrix.target }}
path: fuzz/artifacts
if-no-files-found: ignore