Skip to content

Commit

Permalink
Merge pull request #695 from Chia-Network/move-fuzzers
Browse files Browse the repository at this point in the history
Move fuzzers to build-crate.yml
  • Loading branch information
Rigidity committed Aug 30, 2024
2 parents f8666ad + 19b3644 commit 2026d01
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 43 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build-crate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,51 @@ jobs:
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.cargo_registry_token }}
run: cargo ws publish --publish-as-is

fuzz_tests:
runs-on: ubuntu-latest
env:
CARGO_PROFILE_RELEASE_LTO: false
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@nightly

- name: Install cargo-fuzz
run: cargo +nightly install cargo-fuzz

- name: Fuzz (chia-consensus)
run: |
cd crates/chia-consensus
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=20 || exit 255"
- name: Fuzz (chia-bls)
env:
# We disable leak reports here because blspy appears to be allocating
# memory that's not freed. It might be a false positive since python is
# not unloaded before exiting.
LSAN_OPTIONS: detect_leaks=0
run: |
cd crates/chia-bls
python -m pip install blspy
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=10 || exit 255"
- name: Fuzz (clvm-utils)
run: |
cd crates/clvm-utils
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=20 || exit 255"
- name: Fuzz (chia-protocol)
run: |
cd crates/chia-protocol
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=20 || exit 255"
- name: Fuzz (chia-puzzles)
run: |
cd crates/chia-puzzles
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=20 || exit 255"
- name: Fuzz (clvm-traits)
run: |
cd crates/clvm-traits
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=20 || exit 255"
43 changes: 0 additions & 43 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -290,49 +290,6 @@ jobs:
run: |
cargo clippy --workspace --all-features --all-targets
fuzz_targets:
runs-on: ubuntu-latest
env:
CARGO_PROFILE_RELEASE_LTO: false
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: cargo-fuzz
run: cargo +nightly install cargo-fuzz
- name: cargo fuzz (chia-consensus)
run: |
cd crates/chia-consensus
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=20 || exit 255"
- name: cargo fuzz (chia-bls)
env:
# we disable leak reports here because blspy appears to be allocating
# memory that's not freed. It might be a false positive since python is
# not unloaded before exiting
LSAN_OPTIONS: detect_leaks=0
run: |
cd crates/chia-bls
python -m pip install blspy
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=10 || exit 255"
- name: cargo fuzz (clvm-utils)
run: |
cd crates/clvm-utils
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=20 || exit 255"
- name: cargo fuzz (chia-protocol)
run: |
cd crates/chia-protocol
cargo +nightly fuzz build
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=20 || exit 255"
- name: cargo fuzz (chia-puzzles)
run: |
cd crates/chia-puzzles
cargo +nightly fuzz build
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=20 || exit 255"
- name: cargo fuzz (clvm-traits)
run: |
cd crates/clvm-traits
cargo +nightly fuzz build
cargo fuzz list | xargs -I "%" sh -c "cargo +nightly fuzz run % -- -max_total_time=20 || exit 255"
unit_tests:
runs-on: ${{ matrix.os }}
strategy:
Expand Down

0 comments on commit 2026d01

Please sign in to comment.