From 805196a636b0329400086f806241f70b82da927f Mon Sep 17 00:00:00 2001 From: ado Date: Sun, 3 Mar 2024 01:50:54 +0100 Subject: [PATCH] Remove oss-fuzz ci, add custom fuzzing ci --- .github/workflows/fuzz.yml | 61 +++++++++++++++++++------------------- fuzz/build.sh | 5 ---- fuzz/makefile | 2 ++ 3 files changed, 33 insertions(+), 35 deletions(-) delete mode 100755 fuzz/build.sh create mode 100644 fuzz/makefile diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 9d4f740..22fe0e7 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -1,4 +1,4 @@ -name: coverage-ci +name: fuzz-ci on: workflow_dispatch: @@ -18,39 +18,40 @@ on: - bugfix/** jobs: - fuzzing: + clang_tests: + if: >- + ! contains(toJSON(github.event.commits.*.message), '[skip ci]') && + ! contains(toJSON(github.event.commits.*.message), '[skip github]') + runs-on: ubuntu-latest name: "Fuzzing" - + + container: + image: silkeh/clang:15 + options: -v /usr/local:/host_usr_local + + env: + CC: clang + CXX: clang++ + CXXFLAGS: -stdlib=libc++ + steps: - - name: Build Fuzzers - id: build - uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master - with: - oss-fuzz-project-name: 'ssp' - language: c++ + - uses: actions/checkout@v1 - - name: Run Fuzzers - uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master - with: - oss-fuzz-project-name: 'ssp' - language: c++ - fuzz-seconds: 60 - output-sarif: true + - uses: friendlyanon/fetch-core-count@v1 + id: cores - - name: Upload Crash - uses: actions/upload-artifact@v3 - if: failure() && steps.build.outcome == 'success' - with: - name: artifacts - path: ./out/artifacts + - name: Install dependencies + run: | + apt-get update + apt-get install -y git + script/ci_install_deps.sh - - name: Upload Sarif - if: always() && steps.build.outcome == 'success' - uses: github/codeql-action/upload-sarif@v2 - with: - # Path to SARIF file relative to the root of the repository - sarif_file: cifuzz-sarif/results.sarif - checkout_path: cifuzz-sarif - category: CIFuzz + - name: Build + working-directory: fuzz + run: make + + - name: Run + working-directory: fuzz + run: ssp_fuz -max_total_time=30 diff --git a/fuzz/build.sh b/fuzz/build.sh deleted file mode 100755 index e1fe684..0000000 --- a/fuzz/build.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env sh - -$CXX $CFLAGS $CXXFLAGS $LIB_FUZZING_ENGINE $SRC/fuzz/ssp_fuzz.cpp - -I $SRC/include - -o $OUT/ssp_fuzz diff --git a/fuzz/makefile b/fuzz/makefile new file mode 100644 index 0000000..6634846 --- /dev/null +++ b/fuzz/makefile @@ -0,0 +1,2 @@ +all: + clang++ -std=c++17 -o ssp_fuzz ssp_fuzz.cpp -g -fsanitize=fuzzer