mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-18 05:58:19 +00:00
ec965d7d0b
The ASan/UBSan logs are currently only printed in the CI log when launching the client and server once. Now the logs are also printed when the unit or integration tests fail due to a sanitizer crash. A redundant definition of an environment variable is removed.
61 lines
2.2 KiB
YAML
61 lines
2.2 KiB
YAML
name: Check ASan & UBSan
|
|
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- master
|
|
- staging.tmp
|
|
- trying.tmp
|
|
- staging-squash-merge.tmp
|
|
pull_request:
|
|
|
|
jobs:
|
|
check-clang-san:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
|
|
- name: Prepare linux
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install pkg-config cmake ninja-build libfreetype6-dev libnotify-dev libsdl2-dev libsqlite3-dev libavcodec-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev libx264-dev libvulkan-dev glslang-tools spirv-tools -y
|
|
- name: Build with ASan and UBSan
|
|
run: |
|
|
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 -DHEADLESS_CLIENT=ON -Werror=dev -DDOWNLOAD_GTEST=ON -DDEV=ON -DCMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG=. .
|
|
make -j"$(nproc)"
|
|
- name: Run server and headless client with ASan and UBSan
|
|
run: |
|
|
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 "cl_download_skins 0;quit" || true
|
|
./DDNet-Server shutdown || true
|
|
if test -n "$(find . -maxdepth 1 -name 'SAN.*' -print -quit)"
|
|
then
|
|
cat ./SAN.*
|
|
exit 1
|
|
fi
|
|
- name: Run unit tests with ASan and UBSan
|
|
run: |
|
|
cmake --build . --config Debug --target run_cxx_tests
|
|
# Rust tests work locally, but still not in CI, even with the same directory
|
|
if test -n "$(find . -maxdepth 1 -name 'SAN.*' -print -quit)"
|
|
then
|
|
cat ./SAN.*
|
|
exit 1
|
|
fi
|
|
- name: Run integration tests with ASan and UBSan
|
|
run: |
|
|
make run_integration_tests
|
|
if test -n "$(find . -maxdepth 1 -name 'SAN.*' -print -quit)"
|
|
then
|
|
cat ./SAN.*
|
|
exit 1
|
|
fi
|