2020-09-05 18:29:19 +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: address sanitizer
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2022-08-26 23:25:07 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-09-05 18:29:19 +02:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
2022-05-31 19:55:57 +02:00
|
|
|
runs-on: ubuntu-22.04
|
2020-09-05 18:29:19 +02:00
|
|
|
|
2021-03-05 21:55:57 +01:00
|
|
|
env:
|
|
|
|
ASAN_OPTIONS: detect_stack_use_after_return=1
|
|
|
|
|
2020-09-05 18:29:19 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
2022-01-29 20:44:26 +01:00
|
|
|
- name: Set up Python 3.10
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.10'
|
|
|
|
|
2020-09-05 18:29:19 +02:00
|
|
|
- name: Install missing software on ubuntu
|
|
|
|
run: |
|
2022-08-23 21:40:31 +02:00
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y cmake make libpcre3-dev
|
|
|
|
|
|
|
|
- name: Install clang
|
|
|
|
run: |
|
|
|
|
wget https://apt.llvm.org/llvm.sh
|
|
|
|
chmod +x llvm.sh
|
2022-08-25 15:28:39 +02:00
|
|
|
sudo ./llvm.sh 15
|
2020-09-05 18:29:19 +02:00
|
|
|
|
2022-06-03 21:33:56 +02:00
|
|
|
- name: CMake
|
|
|
|
run: |
|
|
|
|
cmake -S . -B cmake.output -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTS=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_ADDRESS=On -DENABLE_CHECK_INTERNAL=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On
|
2021-03-05 21:55:57 +01:00
|
|
|
env:
|
2022-08-25 15:28:39 +02:00
|
|
|
CC: clang-15
|
|
|
|
CXX: clang++-15
|
2022-06-03 21:33:56 +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)
|
2020-09-05 18:29:19 +02:00
|
|
|
|
|
|
|
- name: Run tests
|
2022-06-03 21:33:56 +02:00
|
|
|
run: ./cmake.output/bin/testrunner
|
2021-02-20 13:34:57 +01:00
|
|
|
|
2022-09-06 23:11:39 +02:00
|
|
|
# TODO: re-enable - was being killed because of increased memory usage
|
|
|
|
# TODO: only fail the step on sanitizer issues
|
2022-06-03 21:33:56 +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=1 --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-06-03 21:33:56 +02:00
|
|
|
ec=0
|
2022-09-06 23:11:39 +02:00
|
|
|
./cmake.output/bin/cppcheck $selfcheck_options --addon=naming.json cli lib || ec=1
|
|
|
|
./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-06-03 21:33:56 +02:00
|
|
|
exit $ec
|