name: Fuzz
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "41 3 * * 1"
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
fuzz:
name: Fuzz ${{ matrix.target }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
target: [pattern-compile, pattern-match, scanner-api, match-cache]
env:
RUSTUP_TOOLCHAIN: nightly
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 - uses: dtolnay/rust-toolchain@02cb101ec7c40f2c49e1d9714d64511d8e1b74de with:
toolchain: nightly
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 with:
workspaces: fuzz
- name: Install cargo-fuzz
run: cargo install cargo-fuzz --version 0.13.2 --locked
- name: Fuzz ${{ matrix.target }}
env:
MAX_TOTAL_TIME: ${{ (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && '900' || '60' }}
run: >-
cargo fuzz run ${{ matrix.target }} --
-dict=fuzz/ferroni.dict
-max_total_time="$MAX_TOTAL_TIME"
-max_len=16384
-timeout=10
-rss_limit_mb=2048
- name: Upload crash artifacts
if: failure()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with:
name: fuzz-artifacts-${{ matrix.target }}
path: fuzz/artifacts
if-no-files-found: ignore
retention-days: 7