2022-08-23 20:30:45 +02:00
|
|
|
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
|
|
|
|
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
|
|
|
|
name: thread sanitizer
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2022-08-26 23:25:07 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-08-23 20:30:45 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
|
|
|
|
env:
|
|
|
|
TSAN_OPTIONS: halt_on_error=1
|
|
|
|
|
|
|
|
steps:
|
2022-10-11 19:50:59 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-08-23 20:30:45 +02:00
|
|
|
|
2022-10-25 21:53:02 +02:00
|
|
|
- name: Set up Python 3.11
|
2022-10-11 19:50:59 +02:00
|
|
|
uses: actions/setup-python@v4
|
2022-08-23 20:30:45 +02:00
|
|
|
with:
|
2022-10-25 21:53:02 +02:00
|
|
|
python-version: '3.11'
|
|
|
|
check-latest: true
|
2022-08-23 20:30:45 +02:00
|
|
|
|
|
|
|
- name: Install missing software on ubuntu
|
|
|
|
run: |
|
2022-08-23 21:40:31 +02:00
|
|
|
sudo apt-get update
|
2022-09-27 18:49:18 +02:00
|
|
|
sudo apt-get install -y cmake make libpcre3-dev libboost-container-dev
|
2022-08-23 21:40:31 +02:00
|
|
|
|
|
|
|
- name: Install clang
|
|
|
|
run: |
|
|
|
|
wget https://apt.llvm.org/llvm.sh
|
|
|
|
chmod +x llvm.sh
|
2023-02-15 19:46:13 +01:00
|
|
|
sudo ./llvm.sh 16
|
2022-08-23 20:30:45 +02:00
|
|
|
|
|
|
|
- name: CMake
|
|
|
|
run: |
|
2022-09-27 18:49:18 +02:00
|
|
|
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_THREAD=On -DUSE_THREADS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On
|
2022-08-23 20:30:45 +02:00
|
|
|
env:
|
2023-02-15 19:46:13 +01:00
|
|
|
CC: clang-16
|
|
|
|
CXX: clang++-16
|
2022-08-23 20:30:45 +02:00
|
|
|
|
|
|
|
- name: Build cppcheck
|
|
|
|
run: |
|
|
|
|
cmake --build cmake.output --target cppcheck -- -j $(nproc)
|
|
|
|
|
|
|
|
- name: Build test
|
|
|
|
run: |
|
|
|
|
cmake --build cmake.output --target testrunner -- -j $(nproc)
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: ./cmake.output/bin/testrunner
|
|
|
|
|
|
|
|
# TODO: disabled for now as it takes around 40 minutes to finish
|
2022-09-06 23:11:39 +02:00
|
|
|
# set --error-exitcode=0 so we only fail on sanitizer issues - since it uses threads for execution it will exit the whole process on the first issue
|
2022-08-23 20:30:45 +02:00
|
|
|
- name: Self check
|
|
|
|
if: false
|
|
|
|
run: |
|
2022-09-06 23:11:39 +02:00
|
|
|
selfcheck_options="-q -j$(nproc) --std=c++11 --template=selfcheck --showtime=top5 -D__CPPCHECK__ --error-exitcode=0 --inline-suppr --suppressions-list=.selfcheck_suppressions --library=cppcheck-lib -Ilib -Iexternals/simplecpp/ -Iexternals/tinyxml2/ --inconclusive --enable=style,performance,portability,warning,missingInclude,internal --exception-handling --debug-warnings"
|
2022-08-23 20:30:45 +02:00
|
|
|
ec=0
|
2022-09-24 22:14:04 +02:00
|
|
|
./cmake.output/bin/cppcheck $selfcheck_options --addon=naming.json -DCHECK_INTERNAL cli lib || ec=1
|
2022-09-06 23:11:39 +02:00
|
|
|
./cmake.output/bin/cppcheck $selfcheck_options -DQT_VERSION=0x050000 -DQ_MOC_OUTPUT_REVISION=67 --library=qt --addon=naming.json -Igui/temp -Igui gui/*.cpp gui/temp/*.cpp || ec=1
|
|
|
|
./cmake.output/bin/cppcheck $selfcheck_options -Icli test/*.cpp tools/*.cpp || ec=1
|
|
|
|
./cmake.output/bin/cppcheck $selfcheck_options -DQ_MOC_OUTPUT_REVISION=67 --library=qt -Itools/triage/temp -Igui tools/triage/*.cpp tools/triage/temp/*.cpp || ec=1
|
2022-08-23 20:30:45 +02:00
|
|
|
exit $ec
|