Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI test-case for oss-fuzz build #13

Merged
merged 2 commits into from
May 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 55 additions & 2 deletions .github/workflows/build_testcases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
branches: ["main"]
pull_request:
branches: ["main"]
schedule:
- cron: '30 5 * * *'

jobs:
build_test_artifacts:
name: Build Testcases
runs-on: ubuntu-22.04
tklengyel marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ubuntu-latest
container:
image: ghcr.io/tianocore/containers/ubuntu-22-build
defaults:
Expand Down Expand Up @@ -44,11 +46,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