CI: Rework fuzzing and sanitizing
This commit is contained in:
parent
5a306ef0cb
commit
8094949001
|
|
@ -4,6 +4,7 @@ on:
|
|||
pull_request:
|
||||
push:
|
||||
paths-ignore:
|
||||
- '.github/workflows/linux-build.yml'
|
||||
- '.github/workflows/msys2-build.yml'
|
||||
- '.github/workflows/windows-build.yml'
|
||||
- '.gitignore'
|
||||
|
|
@ -19,7 +20,7 @@ jobs:
|
|||
matrix:
|
||||
os: [ubuntu-20.04]
|
||||
arch: [x86_64]
|
||||
mode: [debug, releasedbg]
|
||||
mode: [asan]
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
if: "!contains(github.event.head_commit.message, 'ci skip')"
|
||||
|
|
@ -35,12 +36,16 @@ jobs:
|
|||
- name: Install system dependencies
|
||||
run: |
|
||||
sudo apt-get install libsndfile1-dev libfreetype6-dev libsdl2-dev mesa-common-dev libxcb-ewmh-dev libxcb-randr0-dev libxcb-icccm4-dev libxcb-keysyms1-dev libgl1-mesa-dev git -y
|
||||
sudo apt-get install libunwind8-dev libunwind-dev binutils-dev clang-11 -y
|
||||
sudo apt-get install qtbase5-dev qtdeclarative5-dev
|
||||
sudo apt-get install libunwind-dev binutils-dev clang-11 -y
|
||||
|
||||
git clone https://github.com/google/honggfuzz
|
||||
make -C honggfuzz
|
||||
|
||||
# Install Honggfuzz
|
||||
- name: Build and install Hongfuzz
|
||||
run: |
|
||||
wget https://github.com/google/honggfuzz/archive/refs/tags/2.5.tar.gz -O honggfuzz.tar.gz
|
||||
tar -xzvf honggfuzz.tar.gz
|
||||
cd honggfuzz-*/
|
||||
make
|
||||
sudo make install
|
||||
|
||||
# Force xmake to a specific folder (for cache)
|
||||
- name: Set xmake env
|
||||
|
|
@ -70,21 +75,15 @@ jobs:
|
|||
|
||||
# Setup compilation mode and install project dependencies
|
||||
- name: Configure xmake and install dependencies
|
||||
run: xmake config --shadernodes=y --tests=y --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --verbose --yes --ld=$(pwd)/honggfuzz/hfuzz_cc/hfuzz-clang++ --sh=$(pwd)/honggfuzz/hfuzz_cc/hfuzz-clang++ --ar=$(pwd)/honggfuzz/hfuzz_cc/hfuzz-clang++ --cxx=$(pwd)/honggfuzz/hfuzz_cc/hfuzz-clang++ --cxxflags="-fsanitize=fuzzer-no-link,address" --ldflags=-fsanitize=fuzzer-no-link,address --shflags=-fsanitize=fuzzer-no-link,address --arflags=-fsanitize=fuzzer-no-link,address --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --yes --verbose
|
||||
run: xmake config --shadernodes=y --tests=y --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --verbose --yes
|
||||
|
||||
# Configure xmake with honggfuzz to build the engine
|
||||
- name: Configure xmake with honggfuzz
|
||||
run: xmake config --shadernodes=y --tests=y --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --verbose --toolchain=hfuzz-clang
|
||||
|
||||
# Build the engine
|
||||
- name: Build Nazara
|
||||
run: xmake -v
|
||||
|
||||
- name: Run Sanitized Nazaras
|
||||
- name: Run Nazara Unit tests
|
||||
run: xmake run NazaraUnitTests
|
||||
|
||||
# Install the result files
|
||||
- name: Install Nazara
|
||||
run: xmake install -vo package
|
||||
|
||||
# Upload artifacts
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }}
|
||||
path: package
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ on:
|
|||
pull_request:
|
||||
push:
|
||||
paths-ignore:
|
||||
- '.github/workflows/linux-build-sanitizer.yml'
|
||||
- '.github/workflows/msys2-build.yml'
|
||||
- '.github/workflows/windows-build.yml'
|
||||
- '.gitignore'
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ on:
|
|||
pull_request:
|
||||
push:
|
||||
paths-ignore:
|
||||
- '.github/workflows/linux-build-sanitizer.yml'
|
||||
- '.github/workflows/linux-build.yml'
|
||||
- '.github/workflows/windows-build.yml'
|
||||
- '.gitignore'
|
||||
|
|
@ -76,7 +77,7 @@ jobs:
|
|||
|
||||
# Build the engine
|
||||
- name: Build Nazara
|
||||
run: xmake -v
|
||||
run: xmake
|
||||
|
||||
# Install the result files
|
||||
- name: Install Nazara
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ on:
|
|||
pull_request:
|
||||
push:
|
||||
paths-ignore:
|
||||
- '.github/workflows/linux-build-sanitizer.yml'
|
||||
- '.github/workflows/linux-build.yml'
|
||||
- '.github/workflows/msys2-build.yml'
|
||||
- '.gitignore'
|
||||
|
|
|
|||
|
|
@ -103,11 +103,9 @@ local modules = {
|
|||
}
|
||||
}
|
||||
|
||||
-- remove_headerfiles and remove_files were added in xmake 2.6.3, add a fallback for previous versions
|
||||
remove_files = remove_files or del_files
|
||||
remove_headerfiles = remove_headerfiles or function () end
|
||||
includes("xmake/**.lua")
|
||||
|
||||
set_xmakever("2.5.6")
|
||||
set_xmakever("2.6.3")
|
||||
|
||||
add_repositories("local-repo xmake-repo")
|
||||
|
||||
|
|
@ -230,7 +228,6 @@ for name, module in pairs(modules) do
|
|||
end
|
||||
end
|
||||
|
||||
includes("xmake/actions/*.lua")
|
||||
includes("tools/xmake.lua")
|
||||
includes("tests/xmake.lua")
|
||||
includes("plugins/*/xmake.lua")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
toolchain("hfuzz-clang")
|
||||
|
||||
set_homepage("https://honggfuzz.dev")
|
||||
set_description("Security oriented software fuzzer. Supports evolutionary, feedback-driven fuzzing based on code coverage (SW and HW based)")
|
||||
|
||||
set_kind("standalone")
|
||||
|
||||
set_toolset("cc", "hfuzz-clang")
|
||||
set_toolset("cxx", "hfuzz-clang++")
|
||||
set_toolset("ld", "hfuzz-clang++", "hfuzz-clang")
|
||||
set_toolset("sh", "hfuzz-clang++", "hfuzz-clang")
|
||||
set_toolset("ar", "ar")
|
||||
set_toolset("strip", "strip")
|
||||
set_toolset("mm", "hfuzz-clang")
|
||||
set_toolset("mxx", "hfuzz-clang++")
|
||||
set_toolset("as", "hfuzz-clang")
|
||||
|
||||
add_cxflags("-fsanitize=fuzzer-no-link")
|
||||
add_ldflags("-fsanitize=fuzzer-no-link")
|
||||
add_shflags("-fsanitize=fuzzer-no-link")
|
||||
add_arflags("-fsanitize=fuzzer-no-link")
|
||||
|
||||
on_check(function (toolchain)
|
||||
return import("lib.detect.find_tool")("hfuzz-clang")
|
||||
end)
|
||||
|
||||
on_load(function (toolchain)
|
||||
local march
|
||||
if toolchain:is_arch("x86_64", "x64") then
|
||||
march = "-m64"
|
||||
elseif toolchain:is_arch("i386", "x86") then
|
||||
march = "-m32"
|
||||
end
|
||||
if march then
|
||||
toolchain:add("cxflags", march)
|
||||
toolchain:add("ldflags", march)
|
||||
toolchain:add("shflags", march)
|
||||
end
|
||||
end)
|
||||
Loading…
Reference in New Issue