Skip to content

Commit dbc47a1

Browse files
committed
ci: add testfuzz workflow
Adds the `testfuzz` workflow to CI for a short fuzz test run on each pull request.
1 parent 45cfffc commit dbc47a1

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,44 @@ jobs:
5050
- name: Run miri
5151
run: MIRIFLAGS=-Zmiri-ignore-leaks cargo miri test --features="alloc,defmt,mpmc_large,portable-atomic-critical-section,serde,ufmt,bytes"
5252

53+
# Run cargo-fuzz tests on nightly
54+
testfuzz:
55+
name: testfuzz
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v4
60+
61+
- name: Cache cargo dependencies
62+
uses: actions/cache@v3
63+
with:
64+
path: |
65+
- ~/.cargo/bin/
66+
- ~/.cargo/registry/index/
67+
- ~/.cargo/registry/cache/
68+
- ~/.cargo/git/db/
69+
key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
70+
restore-keys: |
71+
${{ runner.OS }}-cargo-
72+
73+
- name: Cache build output dependencies
74+
uses: actions/cache@v3
75+
with:
76+
path: target
77+
key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }}
78+
restore-keys: |
79+
${{ runner.OS }}-build-
80+
81+
- name: Install Rust
82+
uses: dtolnay/rust-toolchain@master
83+
with:
84+
toolchain: nightly
85+
86+
- name: Run cargo-fuzz test
87+
run:
88+
- cargo install --locked cargo-fuzz
89+
- cargo +nightly fuzz run fuzz_vec -- -runs=16384 -max_len=4096
90+
5391
# Run cargo test
5492
test:
5593
name: test

0 commit comments

Comments
 (0)