-
-
Notifications
You must be signed in to change notification settings - Fork 56
43 lines (41 loc) · 1.29 KB
/
fuzzing.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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.2
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: |
cd crates/${{ matrix.crate }}
cargo fuzz run decode_value -- -timeout=5 -max_len=2048 -runs=2000000 -only_ascii=1 \
socketioxide-fuzzing-corpus-$TEST_DATA_VERSION/corpus-${{ matrix.crate }}