Skip to content

Commit

Permalink
Merge pull request #13 from tklengyel/ci
Browse files Browse the repository at this point in the history
Add CI test-case for oss-fuzz build
  • Loading branch information
el-tipton authored May 9, 2024
2 parents 75e6588 + 6684708 commit f6660c7
Showing 1 changed file with 55 additions and 2 deletions.
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
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

0 comments on commit f6660c7

Please sign in to comment.