Skip to content

Commit 5ad0c98

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 5ad0c98

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-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

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
99

1010
- Make MSRV of 1.87.0 explicit.
1111

12+
### Added
13+
14+
- Added `Vec` fuzz test harness + CI runner.
15+
1216
## [v0.9.1] - 2025-08-19
1317

1418
### Added

0 commit comments

Comments
 (0)