Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ updates:
# Policy pins move by hand to a reviewed release-policy commit.
- dependency-name: "ryanduguid/release-policy/.github/workflows/*"
- package-ecosystem: cargo
directory: /
directories: [/, /fuzz]
schedule:
interval: weekly
cooldown:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Fuzz

on:
schedule:
- cron: '41 3 * * 1'
workflow_dispatch:

permissions:
contents: read

jobs:
fuzz:
strategy:
fail-fast: false
matrix:
target: [register_letters, letter_text]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install nightly and the pinned cargo-fuzz
run: |
rustup toolchain install nightly --profile minimal
cargo +nightly install cargo-fuzz --locked --version 0.13.2
# The shipped register seeds the entry target and the letter templates the text target.
- name: Fuzz for 5 minutes
env:
TARGET: ${{ matrix.target }}
run: |
if [ "$TARGET" = register_letters ]; then seeds=registry/au; else seeds=letters/au; fi
mkdir -p "fuzz/corpus/$TARGET"
cargo +nightly fuzz run "$TARGET" "fuzz/corpus/$TARGET" "$seeds" -- -max_total_time=300 -rss_limit_mb=4096
- name: Keep the crashing input
if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: fuzz-${{ matrix.target }}
path: fuzz/artifacts/${{ matrix.target }}
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ cargo run -- registry check --path registry/au
```

New functionality and bug fixes come with automated tests, in `tests/` or a `#[cfg(test)]` module beside the code, and CI runs them on Linux and Windows.

Changes to the register check or the letters should also survive the fuzz targets in `fuzz/`, which CI runs for 5 minutes each every Monday. They need a nightly toolchain and `cargo install cargo-fuzz`; run one with `cargo +nightly fuzz run register_letters` (or `letter_text`); CI seeds them from `registry/au` and `letters/au`. A crash leaves its input in `fuzz/artifacts/`; turn it into a test before fixing it.
4 changes: 4 additions & 0 deletions fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target
corpus
artifacts
coverage
Loading
Loading