diff --git a/.github/workflows/fuzzing.yml b/.github/workflows/fuzzing.yml new file mode 100644 index 00000000..c70a8df4 --- /dev/null +++ b/.github/workflows/fuzzing.yml @@ -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 }} diff --git a/v0.0.1.zip b/v0.0.1.zip new file mode 100644 index 00000000..962fcc44 Binary files /dev/null and b/v0.0.1.zip differ