Skip to content

Commit

Permalink
Add CI test-case for oss-fuzz build
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamas K Lengyel committed May 8, 2024
1 parent 1186805 commit abc587b
Showing 1 changed file with 53 additions and 2 deletions.
55 changes: 53 additions & 2 deletions .github/workflows/build_testcases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -44,11 +44,62 @@ 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 && \
cp HBFA/UefiHostFuzzTestPkg/Conf/build_rule.txt edk2/Conf/build_rule.txt && \
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

0 comments on commit abc587b

Please sign in to comment.