Skip to content

Commit

Permalink
chore(ci): add fuzzing
Browse files Browse the repository at this point in the history
  • Loading branch information
Totodore committed Oct 3, 2024
1 parent a449200 commit fc687b1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/fuzzing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: fuzzing
on: [pull_request]

permissions:
contents: read

jobs:
fuzzing:
strategy:
fail-fast: false
matrix:
crate: [parser-common, parser-msgpack]
environment: dev
runs-on: ubuntu-latest
env:
TEST_DATA_VERSION: 0.0.1
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-fuzzing
- run: cargo install cargo-fuzz
- name: download corpus data
run: |
cd crates/${{ matrix.crate }}
wget https://github.com/Totodore/socketioxide-fuzzing-corpus/archive/refs/tags/v$TEST_DATA_VERSION.zip
unzip v$TEST_DATA_VERSION.zip
rm v$TEST_DATA_VERSION.zip
- name: cargo fuzz run decode_value
run: cargo fuzz run decode_value -- -timeout=5 -max_len=2048 -runs=2000000 -only_ascii=1 corpus-${{ matrix.crate }}
Binary file added v0.0.1.zip
Binary file not shown.

0 comments on commit fc687b1

Please sign in to comment.