-
Notifications
You must be signed in to change notification settings - Fork 2
111 lines (101 loc) · 3.17 KB
/
build_testcases.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
---
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