Build Testcases #182
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Build Testcases | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
schedule: | |
- cron: '30 5 * * *' | |
permissions: {} | |
jobs: | |
build_test_artifacts: | |
name: Build Testcases | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
container: | |
image: ghcr.io/tianocore/containers/ubuntu-22-build | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install Dependencies | |
run: | | |
sudo apt-get -y update && \ | |
sudo apt-get -y install \ | |
clang libclang-dev llvm | |
- name: Retrieve and build EDK2 | |
run: | | |
git clone https://github.com/tianocore/edk2.git --recursive && \ | |
pushd edk2 && make -C BaseTools && \ | |
source edksetup.sh && popd && \ | |
export -p > envsave | |
- name: Setting up HBFA-FL and Build Environment | |
run: | | |
source envsave && \ | |
export WORKSPACE=$(pwd)/ && \ | |
export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/HBFA/ && \ | |
python3 HBFA/UefiHostTestTools/HBFAEnvSetup.py && \ | |
export -p > envsave | |
- name: Install AFL-2.52b | |
run: | | |
source envsave && \ | |
wget -q http://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz && \ | |
tar xf afl-latest.tgz && rm afl-latest.tgz && \ | |
export AFL_PATH=$WORKSPACE/afl-2.52b && \ | |
export PATH=$PATH:$AFL_PATH && \ | |
export -p > envsave && \ | |
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 |