Skip to content

Switch to cargo-fuzz #321

Switch to cargo-fuzz

Switch to cargo-fuzz #321

Workflow file for this run

# Automatically generated by fuzz/generate-files.sh
name: Fuzz
on:
push:
branches:
- master
- 'test-ci/**'
pull_request:
jobs:
fuzz:
name: Run Fuzz Target
if: ${{ !github.event.act }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
fuzz_target: [
c_rust_merkle,
decode_natural,
decode_program,
parse_human,
]
steps:
- name: Checkout Crate
uses: actions/checkout@v4
- name: Use Rust Cache
uses: actions/cache@v3
id: cache-fuzz
with:
path: |
~/.cargo/bin
fuzz/target
target
key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: Install Toolchain
uses: dtolnay/rust-toolchain@nightly-2027-07-01
with:
components: "llvm-tools-preview"
- name: Install Dependencies
run: cargo update && cargo update -p cc --precise 1.0.83 && cargo install cargo-fuzz
- name: Run Fuzz Target
run: ./fuzz/fuzz.sh "${{ matrix.fuzz_target }}"
- name: Upload Artifacts
run: echo "${{ matrix.fuzz_target }}" >executed_${{ matrix.fuzz_target }}
uses: actions/upload-artifact@v3
with:
name: executed_${{ matrix.fuzz_target }}
path: executed_${{ matrix.fuzz_target }}
verify-execution:
name: Verify Execution of All Targets
if: ${{ !github.event.act }}
needs: fuzz
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
- run: find executed_* -type f -exec cat {} + | sort > executed
- run: source ./fuzz/fuzz-util.sh && listTargetNames | sort | diff - executed