starting over (again) #11
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: Check ASan & UBSan | |
on: | |
push: | |
branches-ignore: | |
- gh-readonly-queue/** | |
- master | |
pull_request: | |
merge_group: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check-clang-san: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Prepare linux | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install pkg-config cmake ninja-build libsqlite3-dev -y | |
- name: Build with ASan and UBSan | |
run: | | |
mkdir clang-sanitizer | |
cd clang-sanitizer | |
export CC=clang | |
export CXX=clang++ | |
export CXXFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" | |
export CFLAGS="-fsanitize=address,undefined -fsanitize-recover=address,undefined -fno-omit-frame-pointer" | |
cmake -DCMAKE_BUILD_TYPE=Debug -Werror=dev -DDEV=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=. .. | |
make -j"$(nproc)" | |
- name: Run server with ASan and UBSan | |
run: | | |
cd clang-sanitizer | |
export UBSAN_OPTIONS=suppressions=./ubsan.supp:log_path=./SAN:print_stacktrace=1:halt_on_errors=0 | |
export ASAN_OPTIONS=log_path=./SAN:print_stacktrace=1:check_initialization_order=1:detect_leaks=1:halt_on_errors=0 | |
export LSAN_OPTIONS=suppressions=./lsan.supp | |
./DDNet-Server shutdown || true | |
if test -n "$(find . -maxdepth 1 -name 'SAN.*' -print -quit)" | |
then | |
cat ./SAN.* | |
exit 1 | |
fi |