Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fuzzing targets #2342

Merged
merged 12 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@ jobs:
- run: RUSTFLAGS=-Dwarnings cargo check --package smoldot --locked --no-default-features --features std
- run: RUSTFLAGS=-Dwarnings cargo check --package smoldot --locked --no-default-features --features database-sqlite --features std

fuzzing-binaries-compile:
runs-on: ubuntu-latest
container:
image: rust:nightly
steps:
- uses: actions/checkout@v3
- uses: baptiste0928/cargo-install@v1 # This action ensures that the compilation is cached.
with:
crate: cargo-fuzz
- uses: Swatinem/rust-cache@v1
- run: cargo fuzz build --fuzz-dir ./bin/fuzz

check-rustdoc-links:
runs-on: ubuntu-latest
container:
Expand All @@ -127,6 +139,11 @@ jobs:
with:
command: fmt
args: --all -- --check
- uses: actions-rs/cargo@v1
# The fuzzing targets are in a different package and thus need to be checked separately.
with:
command: fmt
args: --manifest-path ./bin/fuzz/Cargo.toml --all -- --check

# TODO: as explained in the official repo (https://github.com/actions-rs/clippy), this action uses unstable GH actions features, but has the huge advantage of not requiring `GITHUB_TOKEN` and working on PRs from forked repositories ; should eventually replace `actions-rs/clippy@master` with a specific version
clippy:
Expand Down Expand Up @@ -189,7 +206,7 @@ jobs:
all-ci:
# This dummy job depends on all the mandatory checks. It succeeds if and only if CI is
# considered successful.
needs: [test-64bits, test-32bits, wasm-node-check, wasm-node-size-diff, check-features, check-rustdoc-links, fmt, clippy, cargo-deny, cargo-spellcheck, wasm-node-versions-match]
needs: [test-64bits, test-32bits, wasm-node-check, wasm-node-size-diff, check-features, fuzzing-binaries-compile, check-rustdoc-links, fmt, clippy, cargo-deny, cargo-spellcheck, wasm-node-versions-match]
runs-on: ubuntu-latest
steps:
- run: echo Success
3 changes: 3 additions & 0 deletions bin/fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target
corpus
artifacts
Loading