Skip to content

Commit aeb4470

Browse files
committed
try to run the uncompress fuzzer with a custom corpus, and codecov
1 parent b3707de commit aeb4470

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

.github/workflows/checks.yaml

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

0 commit comments

Comments
 (0)