Skip to content

Commit

Permalink
fuzz: use travis-fuzz.sh in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
apoelstra authored and sanket1729 committed Nov 1, 2022
1 parent 4c6f9b3 commit a0489d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/fuzz.yml
Expand Up @@ -7,8 +7,6 @@ jobs:
fuzz:
if: ${{ !github.event.act }}
runs-on: ubuntu-20.04
env:
HFUZZ_BUILD_ARGS: "--features honggfuzz_fuzz"
strategy:
fail-fast: false
matrix:
Expand All @@ -30,11 +28,8 @@ jobs:
toolchain: 1.58
override: true
profile: minimal
- run: cargo install honggfuzz --no-default-features
if: steps.cache-fuzz.outputs.cache-hit != 'true'
- run: echo "HFUZZ_RUN_ARGS=--run_time 30 --exit_upon_crash -v -f hfuzz_input/${{ matrix.fuzz_target }}/input" >> $GITHUB_ENV
- name: fuzz
run: cd fuzz && cargo hfuzz run ${{ matrix.fuzz_target }}
run: cd fuzz && ./travis-fuzz.sh "${{ matrix.fuzz_target }}"
- run: echo "${{ matrix.fuzz_target }}.rs" >executed_${{ matrix.fuzz_target }}
- uses: actions/upload-artifact@v2
with:
Expand Down
12 changes: 11 additions & 1 deletion fuzz/travis-fuzz.sh
Expand Up @@ -8,9 +8,19 @@ if [ ${incorrectFilenames} -gt 0 ]; then
exit 2
fi

if [ "$1" == "" ]; then
TARGETS=fuzz_targets/*
else
TARGETS=fuzz_targets/"$1".rs
fi

cargo --version
rustc --version

# Testing
cargo install --force honggfuzz --no-default-features
for TARGET in fuzz_targets/*; do
for TARGET in $TARGETS; do
echo "Fuzzing target $TARGET"
FILENAME=$(basename $TARGET)
FILE="${FILENAME%.*}"
if [ -d hfuzz_input/$FILE ]; then
Expand Down

0 comments on commit a0489d4

Please sign in to comment.