From d25aba8ca0225a560e88e183b0db69dd1bd019a1 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Tue, 30 Aug 2022 20:22:47 +0000 Subject: [PATCH] fuzz: use travis-fuzz.sh in CI --- .github/workflows/fuzz.yml | 7 +------ fuzz/travis-fuzz.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 48f96c3d..d698a68c 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -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: @@ -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: diff --git a/fuzz/travis-fuzz.sh b/fuzz/travis-fuzz.sh index 662472c0..1f75c9c0 100755 --- a/fuzz/travis-fuzz.sh +++ b/fuzz/travis-fuzz.sh @@ -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