Fuzz and Sanitize #2688
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
--- | |
name: Fuzz and Sanitize | |
"on": | |
push: | |
branches: | |
- trunk | |
schedule: | |
- cron: "0 12 * * *" | |
env: | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
jobs: | |
fuzz-eval: | |
name: Fuzz eval | |
runs-on: ubuntu-latest | |
env: | |
RUST_BACKTRACE: 1 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4.1.6 | |
- name: Install nightly Rust toolchain | |
uses: artichoke/setup-rust/build-and-test@v1.11.0 | |
with: | |
toolchain: "nightly" | |
- name: Install cargo-fuzz | |
run: cargo install cargo-fuzz | |
- name: Build fuzz targets | |
run: cargo fuzz build | |
- name: Fuzz eval | |
if: github.event_name == 'schedule' | |
run: cargo fuzz run eval -- -max_total_time=1800 # 30 minutes | |
fuzz-kernel-integer: | |
name: Fuzz Kernel#Integer | |
runs-on: ubuntu-latest | |
env: | |
RUST_BACKTRACE: 1 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4.1.6 | |
- name: Install nightly Rust toolchain | |
uses: artichoke/setup-rust/build-and-test@v1.11.0 | |
with: | |
toolchain: "nightly" | |
- name: Install cargo-fuzz | |
run: cargo install cargo-fuzz | |
- name: Build fuzz targets | |
run: cargo fuzz build | |
- name: Fuzz Kernel#Integer with binary input | |
if: github.event_name == 'schedule' | |
run: cargo fuzz run kernel-integer-bytes -- -max_total_time=600 # 10 minutes | |
- name: Fuzz Kernel#Integer with numeric input | |
if: github.event_name == 'schedule' | |
run: cargo fuzz run kernel-integer-int -- -max_total_time=600 # 10 minutes | |
- name: Fuzz Kernel#Integer with UTF-8 input | |
if: github.event_name == 'schedule' | |
run: cargo fuzz run kernel-integer-str -- -max_total_time=600 # 10 minutes | |
leak-san: | |
name: Compile and test with LeakSanitizer | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -Z sanitizer=leak | |
RUST_BACKTRACE: 1 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4.1.6 | |
- name: Install nightly Rust toolchain | |
uses: artichoke/setup-rust/build-and-test@v1.11.0 | |
with: | |
toolchain: "nightly" | |
target: "x86_64-unknown-linux-gnu" | |
- name: Test with leak sanitizer and all features | |
run: cargo test --workspace --all-features --target x86_64-unknown-linux-gnu | |
- name: Test spec-runner with leak sanitizer and all features | |
run: cargo test --workspace --all-features --target x86_64-unknown-linux-gnu | |
working-directory: "spec-runner" |