Skip to content

Commit

Permalink
Add fuzzing and doc testing to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Sep 9, 2024
1 parent dcf1a3e commit eb04011
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,28 @@ jobs:
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
override: true
components: rustfmt, clippy, rust-src

- name: Rust Cache
uses: Swatinem/rust-cache@v2

- name: Install cargo-afl
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-afl
version: "^0.15"

- name: Build project
run: |
cargo build
# AFL fuzzing requires a separate command
cargo build --workspace --all-targets --exclude zksync_vm2_afl_fuzz
- name: Build fuzzer
run: cargo afl build -p zksync_vm2_afl_fuzz

# Two runs are needed. One for normal VM, another for the mocked version
- name: Run clippy
Expand All @@ -47,6 +57,11 @@ jobs:
run: |
cargo fmt --check -- --config imports_granularity=Crate --config group_imports=StdExternalCrate
- name: Run Tests
- name: Run tests
run: |
cargo test -p zksync_vm2_interface -p zksync_vm2 --all-targets
- name: Run fuzzer for a bit
run:
AFL_I_DONT_CARE_ABOUT_MISSING_CRASHES=1 \
cargo afl fuzz -i tests/afl-fuzz/in -o tests/afl-fuzz/out -V 60 target/debug/zksync_vm2_afl_fuzz

0 comments on commit eb04011

Please sign in to comment.