Skip to content

Commit 27b9efd

Browse files
committed
try to run the uncompress fuzzer with a custom corpus, and codecov
1 parent b623176 commit 27b9efd

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

.github/workflows/checks.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,54 @@ jobs:
255255
RUST_BACKTRACE=1 cargo fuzz run --no-default-features --features="$features" $target -- -max_total_time=10
256256
done
257257
258+
fuzz-custom-corpus:
259+
name: Fuzz with a custom corpus
260+
runs-on: ubuntu-latest
261+
strategy:
262+
matrix:
263+
features:
264+
- 'default'
265+
steps:
266+
- name: Checkout sources
267+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
268+
with:
269+
persist-credentials: false
270+
- name: Install nightly toolchain
271+
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248
272+
with:
273+
toolchain: nightly
274+
components: llvm-tools-preview
275+
- name: Install cargo fuzz
276+
uses: taiki-e/install-action@56ab7930c591507f833cbaed864d201386d518a8
277+
with:
278+
tool: cargo-fuzz,cargo-llvm-cov
279+
- name: Fuzz decompression with custom corpus
280+
env:
281+
RUST_BACKTRACE: "1"
282+
run: |
283+
~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-cov show --help
284+
wget https://github.com/folkertdev/compression-corpus/releases/download/2025-04-09-154431/gzip-files.zip
285+
unzip gzip-files.zip -d gzip-files
286+
cargo fuzz run --no-default-features --features="disable-checksum" uncompress2 gzip-files/compressed -- -max_total_time=2
287+
- name: Fuzz codecov
288+
run: |
289+
cargo fuzz coverage --no-default-features --features="disable-checksum" uncompress2 gzip-files/compressed
290+
cargo install rustfilt
291+
~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/llvm-cov export -Xdemangler=rustfilt \
292+
target/x86_64-unknown-linux-gnu/coverage/x86_64-unknown-linux-gnu/release/uncompress2 \
293+
-instr-profile=fuzz/coverage/uncompress/coverage.profdata \
294+
--format=lcov \
295+
-ignore-filename-regex="\.cargo|\.rustup" > lcov.info
296+
- name: Upload coverage to Codecov
297+
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d
298+
with:
299+
files: lcov.info
300+
fail_ci_if_error: false
301+
flags: fuzz,decompress
302+
token: ${{ secrets.CODECOV_TOKEN }}
303+
slug: codecov/codecov-demo
304+
305+
258306
link-c-dynamic-library:
259307
name: vanilla dynamic library
260308
strategy:

0 commit comments

Comments
 (0)