Skip to content

Commit af5ee79

Browse files
ci: Run fuzzers in CI
1 parent 0aab85f commit af5ee79

File tree

5 files changed

+42
-181
lines changed

5 files changed

+42
-181
lines changed

.github/workflows/basic.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,15 @@ jobs:
5454
RUSTDOCFLAGS: -D warnings
5555
run: cargo doc
5656

57-
nightly_only:
58-
name: Nightly only tasks
57+
fuzz:
58+
name:
5959
runs-on: ubuntu-latest
60+
strategy:
61+
matrix:
62+
fuzzer:
63+
- '--fuzz-dir=keyvalues-parser/fuzz parse'
64+
- '--fuzz-dir=keyvalues-serde/fuzz serde'
65+
6066
steps:
6167
- uses: actions/checkout@v4
6268

@@ -71,11 +77,7 @@ jobs:
7177
- name: Cache
7278
uses: Swatinem/rust-cache@v2
7379

74-
# Actually check the fuzzers so that they don't break silently
75-
- name: Check parser fuzzers
76-
run: |
77-
cargo check --manifest-path keyvalues-parser/fuzz/Cargo.toml
78-
79-
- name: Check ser de fuzzers
80+
- name: Run fuzzer
8081
run: |
81-
cargo check --manifest-path keyvalues-serde/fuzz/Cargo.toml
82+
cargo --locked install cargo-fuzz
83+
cargo --locked fuzz run --jobs=4 ${{ matrix.fuzzer }} -- -max_total_time=120 -timeout=30
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#base "one_base.res"
2+
#base ../another_base.vdf
3+
#base other\path\sep.pop
4+
5+
"Key"
6+
{
7+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// a
2+
"Outer Key" // b
3+
{
4+
// c
5+
"Seq Key" "Str Val"
6+
"Seq Key"
7+
{
8+
// d
9+
}
10+
}
11+
// e
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
foo{bar"baz"""{}}//dense

keyvalues-serde/fuzz/Cargo.lock

Lines changed: 12 additions & 172 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)