Create fuzz directory #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks: clvm_rs' github actions. | |
name: Build | |
on: | |
push: | |
branches: | |
- '**' | |
release: | |
types: [published] | |
pull_request: | |
branches: | |
- '**' | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
fuzz_targets: | |
name: Run fuzz targets | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
python: [3.7] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- name: Install rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
components: rustfmt, clippy | |
- name: fmt | |
run: | | |
cd fuzz | |
cargo fmt -- --files-with-diff --check | |
- name: clippy | |
run: | | |
cd fuzz | |
cargo clippy | |
- name: cargo-fuzz | |
run: cargo +nightly install cargo-fuzz | |
# TODO: it would be nice to save and restore the corpus between runs | |
- name: build corpus | |
run: | | |
cd tools | |
cargo run --bin generate-fuzz-corpus | |
- name: build | |
run: cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=30 || exit 255" |