fuzz: use travis-fuzz.sh in CI

This commit is contained in:
Andrew Poelstra 2022-08-30 20:22:47 +00:00
parent 407cbca111
commit d25aba8ca0
2 changed files with 12 additions and 7 deletions

View File

@ -7,8 +7,6 @@ jobs:
fuzz: fuzz:
if: ${{ !github.event.act }} if: ${{ !github.event.act }}
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
env:
HFUZZ_BUILD_ARGS: "--features honggfuzz_fuzz"
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -30,11 +28,8 @@ jobs:
toolchain: 1.58 toolchain: 1.58
override: true override: true
profile: minimal 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 - 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 }} - run: echo "${{ matrix.fuzz_target }}.rs" >executed_${{ matrix.fuzz_target }}
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:

View File

@ -8,9 +8,19 @@ if [ ${incorrectFilenames} -gt 0 ]; then
exit 2 exit 2
fi fi
if [ "$1" == "" ]; then
TARGETS=fuzz_targets/*
else
TARGETS=fuzz_targets/"$1".rs
fi
cargo --version
rustc --version
# Testing # Testing
cargo install --force honggfuzz --no-default-features 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) FILENAME=$(basename $TARGET)
FILE="${FILENAME%.*}" FILE="${FILENAME%.*}"
if [ -d hfuzz_input/$FILE ]; then if [ -d hfuzz_input/$FILE ]; then