From 7e0724d5765bd1b4e145bb9cf2b151c9a73fe9fe Mon Sep 17 00:00:00 2001 From: Zied Aouini Date: Mon, 11 Oct 2021 19:01:50 +0200 Subject: Enable sanitizers on CIFuzz. (#1336) --- .github/workflows/cifuzz.yml | 51 +++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml index ed7b56f2a..0dd0bd91d 100644 --- a/.github/workflows/cifuzz.yml +++ b/.github/workflows/cifuzz.yml @@ -1,23 +1,34 @@ name: CIFuzz on: [pull_request] jobs: - Fuzzing: - runs-on: ubuntu-latest - steps: - - name: Build Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'ndpi' - dry-run: false - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'ndpi' - fuzz-seconds: 600 - dry-run: false - - name: Upload Crash - uses: actions/upload-artifact@v1 - if: failure() - with: - name: artifacts - path: ./out/artifacts + Fuzzing: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + sanitizer: [address, undefined, memory] + steps: + - name: Build Fuzzers - ${{ matrix.sanitizer }} + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + with: + oss-fuzz-project-name: 'ndpi' + dry-run: false + sanitizer: ${{ matrix.sanitizer }} + - name: Run Fuzzers - ${{ matrix.sanitizer }} + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + with: + oss-fuzz-project-name: 'ndpi' + fuzz-seconds: 600 + dry-run: false + sanitizer: ${{ matrix.sanitizer }} + - name: Check Crash (fails when a crash is detected) + # Run Fuzzers return success even when setting dry-run to false. + # A temporal workaround is to trigger failure manually if we fing crash files. + run: | + exit $(ls out/artifacts -l |wc -c) + - name: Upload Crash (upload detected crash as artifacts) + uses: actions/upload-artifact@v1 + if: failure() + with: + name: ${{ matrix.sanitizer }}-artifacts + path: ./out/artifacts -- cgit v1.2.3