name: Fuzzing

on:
  push:
  pull_request:

jobs:
  fuzzing:
    runs-on: ubuntu-latest
    name: fuzzing
    steps:
      - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v5
      - name: build
        run: |
          ./autogen.sh
          CC=clang CXX=clang++ ./configure --enable-sanitizers --enable-fuzzers
          make
      - name: fuzz
        run: "mkdir out\n./src/fuzz/fuzzer \\\n  -max_total_time=\"${MAX_TOTAL_TIME:-300}\" \\\n  -print_pcs=1 \\\n  -workers=\"${FUZZY_WORKERS:-0}\" \\\n  -jobs=\"${FUZZY_JOBS:-0}\" \\\n  -artifact_prefix=./out/ ./src/fuzz/corpus \n"
      - name: Upload Crash
        uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # ratchet:actions/upload-artifact@v5
        if: failure()
        with:
          name: artifacts
          path: ./out








