name: Fuzzing

on:
  push:
  pull_request:

jobs:
  fuzzing:
    runs-on: ubuntu-latest
    name: fuzzing
    steps:
      - uses: actions/checkout@v2
      - name: build
        run: |
          ./autogen.sh
          CC=clang CXX=clang++ ./configure --enable-sanitizers --enable-fuzzers
          make
      - name: fuzz
        run: ./src/fuzz/fuzzer -max_total_time="${MAX_TOTAL_TIME:-300}" -print_pcs=1 -workers="${FUZZY_WORKERS:-0}" -jobs="${FUZZY_JOBS:-0}" ./src/fuzz/corpus 
