diff --git a/.github/workflows/build_testcases.yml b/.github/workflows/build_testcases.yml index bcbb6c3..6d6f0e1 100644 --- a/.github/workflows/build_testcases.yml +++ b/.github/workflows/build_testcases.yml @@ -10,7 +10,7 @@ on: jobs: build_test_artifacts: name: Build Testcases - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest container: image: ghcr.io/tianocore/containers/ubuntu-22-build defaults: @@ -44,7 +44,7 @@ jobs: export AFL_PATH=$WORKSPACE/afl-2.52b && \ export PATH=$PATH:$AFL_PATH && \ export -p > envsave && \ - cd afl-2.52b && make && cd .. + cd afl-2.52b && make && cd .. - name: Build Fuzzing Harnesses run: | source envsave && \ @@ -52,3 +52,54 @@ jobs: cp HBFA/UefiHostFuzzTestPkg/Conf/tools_def.txt edk2/Conf/tools_def.txt && \ build -p HBFA/UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dsc -a X64 -t AFL && \ build -p HBFA/UefiHostFuzzTestCasePkg/UefiHostFuzzTestCasePkg.dsc -a X64 -t LIBFUZZER + + ossfuzz: + name: Build for oss-fuzz + runs-on: ubuntu-latest + container: + image: gcr.io/oss-fuzz-base/base-builder + defaults: + run: + shell: bash + steps: + - name: Install Dependencies + run: | + apt-get -y update + apt-get -y install python3 uuid-dev nasm + + - uses: actions/checkout@v4 + with: + path: hbfa-fl + + - uses: actions/checkout@v4 + with: + repository: tianocore/edk2 + path: edk2 + submodules: true + + - name: move repos + run: | + mv edk2 $SRC + mv hbfa-fl $SRC + + - name: OSS-Fuzz asan build + env: + LIB_FUZZING_ENGINE: "-fsanitize=fuzzer" + SANITIZER: "address" + run: | + $SRC/hbfa-fl/oss-fuzz/build.sh + + - name: OSS-Fuzz ubsan build + env: + LIB_FUZZING_ENGINE: "-fsanitize=fuzzer" + SANITIZER: "undefined" + run: | + $SRC/hbfa-fl/oss-fuzz/build.sh + + - name: OSS-Fuzz coverage build + env: + LIB_FUZZING_ENGINE: "-fsanitize=fuzzer" + SANITIZER: "coverage" + COVERAGE_FLAGS: "placeholder" + run: | + $SRC/hbfa-fl/oss-fuzz/build.sh