Skip to content

Commit d2f98f3

Browse files
authored
consolidated individual sanitizer workflows into a single one (#8275)
1 parent c0d6206 commit d2f98f3

3 files changed

Lines changed: 32 additions & 293 deletions

File tree

.github/workflows/asan.yml

Lines changed: 0 additions & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -1,143 +0,0 @@
1-
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
2-
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
3-
name: address sanitizer
4-
5-
on:
6-
push:
7-
branches:
8-
- 'main'
9-
- 'releases/**'
10-
- '2.*'
11-
tags:
12-
- '2.*'
13-
pull_request:
14-
15-
permissions:
16-
contents: read
17-
18-
jobs:
19-
build:
20-
21-
runs-on: ubuntu-22.04
22-
23-
env:
24-
QT_VERSION: 6.10.0
25-
ASAN_OPTIONS: detect_stack_use_after_return=1
26-
# TODO: figure out why there are cache misses with PCH enabled
27-
CCACHE_SLOPPINESS: pch_defines,time_macros
28-
29-
steps:
30-
- uses: actions/checkout@v4
31-
with:
32-
persist-credentials: false
33-
34-
- name: ccache
35-
uses: hendrikmuhs/ccache-action@v1.2
36-
with:
37-
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
38-
39-
- name: Set up Python
40-
uses: actions/setup-python@v5
41-
with:
42-
python-version: '3.14'
43-
check-latest: true
44-
45-
- name: Install missing software on ubuntu
46-
run: |
47-
sudo apt-get update
48-
sudo apt-get install -y cmake make libpcre3-dev libboost-container-dev libxml2-utils
49-
sudo apt-get install -y libcups2-dev # required for Qt6PrintSupport in CMake since Qt 6.7.3
50-
51-
- name: Install clang
52-
run: |
53-
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
54-
wget https://apt.llvm.org/llvm.sh
55-
chmod +x llvm.sh
56-
sudo ./llvm.sh 22
57-
58-
- name: Install Qt ${{ env.QT_VERSION }}
59-
uses: jurplel/install-qt-action@v4
60-
with:
61-
version: ${{ env.QT_VERSION }}
62-
modules: 'qtcharts'
63-
setup-python: 'false'
64-
cache: true
65-
66-
- name: Install missing Python packages
67-
run: |
68-
python3 -m pip install pip --upgrade
69-
python3 -m pip install pytest
70-
python3 -m pip install pytest-timeout
71-
python3 -m pip install pytest-xdist
72-
python3 -m pip install psutil
73-
74-
- name: CMake
75-
run: |
76-
cmake -S . -B cmake.output -Werror=dev -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_ADDRESS=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
77-
env:
78-
CC: clang-22
79-
CXX: clang++-22
80-
81-
- name: Build cppcheck
82-
run: |
83-
cmake --build cmake.output --target cppcheck -- -j $(nproc)
84-
85-
- name: Build test
86-
run: |
87-
cmake --build cmake.output --target testrunner -- -j $(nproc)
88-
89-
- name: Build GUI tests
90-
run: |
91-
cmake --build cmake.output --target gui-tests -- -j $(nproc)
92-
93-
- name: Run tests
94-
run: ./cmake.output/bin/testrunner
95-
96-
- name: Run cfg tests
97-
run: |
98-
cmake --build cmake.output --target checkcfg -- -j $(nproc)
99-
100-
- name: Run CTest
101-
run: |
102-
ctest --test-dir cmake.output --output-on-failure -j$(nproc)
103-
104-
- name: Run test/cli
105-
run: |
106-
pwd=$(pwd)
107-
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
108-
109-
- name: Run test/cli (-j2)
110-
run: |
111-
pwd=$(pwd)
112-
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
113-
env:
114-
TEST_CPPCHECK_INJECT_J: 2
115-
116-
- name: Run test/cli (--clang)
117-
if: false
118-
run: |
119-
pwd=$(pwd)
120-
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
121-
env:
122-
TEST_CPPCHECK_INJECT_CLANG: clang
123-
124-
- name: Run test/cli (--cppcheck-build-dir)
125-
run: |
126-
pwd=$(pwd)
127-
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
128-
env:
129-
TEST_CPPCHECK_INJECT_BUILDDIR: injected
130-
131-
- name: Generate dependencies
132-
if: false
133-
run: |
134-
# make sure auto-generated GUI files exist
135-
make -C cmake.output autogen
136-
make -C cmake.output gui-build-deps triage-build-ui-deps
137-
138-
# TODO: this is currently way too slow (~60 minutes) to enable it
139-
# TODO: only fail the step on sanitizer issues - since we use processes it will only fail the underlying process which will result in an cppcheckError
140-
- name: Self check
141-
if: false
142-
run: |
143-
./selfcheck_san.sh ./cmake.output
Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
22
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
3-
name: undefined behaviour sanitizers
3+
name: sanitizers
44

55
on:
66
push:
@@ -18,10 +18,33 @@ permissions:
1818
jobs:
1919
build:
2020

21+
strategy:
22+
matrix:
23+
include:
24+
- sanitizer: 'asan'
25+
cmake_opts: '-DANALYZE_ADDRESS=On'
26+
run_ctest: true
27+
inject_executor: 'process'
28+
run_selfcheck: false # TODO: this is currently way too slow (~60 minutes) to enable it
29+
- sanitizer: 'tsan'
30+
cmake_opts: '-DANALYZE_THREAD=On'
31+
run_ctest: false # TODO: test-filelist fails with data race in pthread_cond_destroy
32+
inject_executor: 'thread'
33+
run_selfcheck: false # TODO: disabled for now as it takes around 40 minutes to finish
34+
selfcheck_opts: '--executor=thread --error-exitcode=0' # 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
35+
- sanitizer: 'ubsan'
36+
cmake_opts: '-DANALYZE_UNDEFINED=On'
37+
run_ctest: true
38+
inject_executor: 'process'
39+
run_selfcheck: true
40+
fail-fast: false
41+
2142
runs-on: ubuntu-22.04
2243

2344
env:
2445
QT_VERSION: 6.10.0
46+
ASAN_OPTIONS: detect_stack_use_after_return=1
47+
TSAN_OPTIONS: halt_on_error=1
2548
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1:report_error_type=1
2649
# TODO: figure out why there are cache misses with PCH enabled
2750
CCACHE_SLOPPINESS: pch_defines,time_macros
@@ -34,7 +57,7 @@ jobs:
3457
- name: ccache
3558
uses: hendrikmuhs/ccache-action@v1.2
3659
with:
37-
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
60+
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}-${{ matrix.sanitizer }}
3861

3962
- name: Set up Python
4063
uses: actions/setup-python@v5
@@ -73,7 +96,7 @@ jobs:
7396
7497
- name: CMake
7598
run: |
76-
cmake -S . -B cmake.output -Werror=dev -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_UNDEFINED=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
99+
cmake -S . -B cmake.output -Werror=dev -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify ${{ matrix.cmake_opts }} -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=On -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
77100
env:
78101
CC: clang-22
79102
CXX: clang++-22
@@ -98,13 +121,16 @@ jobs:
98121
cmake --build cmake.output --target checkcfg -- -j $(nproc)
99122
100123
- name: Run CTest
124+
if: matrix.run_ctest
101125
run: |
102126
ctest --test-dir cmake.output --output-on-failure -j$(nproc)
103127
104128
- name: Run test/cli
105129
run: |
106130
pwd=$(pwd)
107131
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
132+
env:
133+
TEST_CPPCHECK_INJECT_EXECUTOR: ${{ matrix.inject_executor }}
108134

109135
- name: Run test/cli (-j2)
110136
run: |
@@ -129,12 +155,14 @@ jobs:
129155
TEST_CPPCHECK_INJECT_BUILDDIR: injected
130156

131157
- name: Generate dependencies
158+
if: matrix.run_selfcheck
132159
run: |
133160
# make sure auto-generated GUI files exist
134161
make -C cmake.output autogen
135162
make -C cmake.output gui-build-deps triage-build-ui-deps
136163
137164
# TODO: only fail the step on sanitizer issues - since we use processes it will only fail the underlying process which will result in an cppcheckError
138165
- name: Self check
166+
if: matrix.run_selfcheck
139167
run: |
140-
./selfcheck_san.sh ./cmake.output
168+
./selfcheck_san.sh ./cmake.output ${{ matrix.selfcheck_opts }}

.github/workflows/tsan.yml

Lines changed: 0 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -1,146 +0,0 @@
1-
# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
2-
# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners
3-
name: thread sanitizer
4-
5-
on:
6-
push:
7-
branches:
8-
- 'main'
9-
- 'releases/**'
10-
- '2.*'
11-
tags:
12-
- '2.*'
13-
pull_request:
14-
15-
permissions:
16-
contents: read
17-
18-
jobs:
19-
build:
20-
21-
runs-on: ubuntu-22.04
22-
23-
env:
24-
QT_VERSION: 6.10.0
25-
TSAN_OPTIONS: halt_on_error=1
26-
# TODO: figure out why there are cache misses with PCH enabled
27-
CCACHE_SLOPPINESS: pch_defines,time_macros
28-
29-
steps:
30-
- uses: actions/checkout@v4
31-
with:
32-
persist-credentials: false
33-
34-
- name: ccache
35-
uses: hendrikmuhs/ccache-action@v1.2
36-
with:
37-
key: ${{ github.workflow }}-${{ github.job }}-${{ matrix.os }}
38-
39-
- name: Set up Python
40-
uses: actions/setup-python@v5
41-
with:
42-
python-version: '3.14'
43-
check-latest: true
44-
45-
- name: Install missing software on ubuntu
46-
run: |
47-
sudo apt-get update
48-
sudo apt-get install -y cmake make libpcre3-dev libboost-container-dev libxml2-utils
49-
sudo apt-get install -y libcups2-dev # required for Qt6PrintSupport in CMake since Qt 6.7.3
50-
51-
- name: Install clang
52-
run: |
53-
sudo apt-get purge --auto-remove llvm python3-lldb-14 llvm-14
54-
wget https://apt.llvm.org/llvm.sh
55-
chmod +x llvm.sh
56-
sudo ./llvm.sh 22
57-
58-
- name: Install Qt ${{ env.QT_VERSION }}
59-
uses: jurplel/install-qt-action@v4
60-
with:
61-
version: ${{ env.QT_VERSION }}
62-
modules: 'qtcharts'
63-
setup-python: 'false'
64-
cache: true
65-
66-
- name: Install missing Python packages
67-
run: |
68-
python3 -m pip install pip --upgrade
69-
python3 -m pip install pytest
70-
python3 -m pip install pytest-timeout
71-
python3 -m pip install pytest-xdist
72-
python3 -m pip install psutil
73-
74-
- name: CMake
75-
run: |
76-
cmake -S . -B cmake.output -Werror=dev -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHAVE_RULES=On -DBUILD_TESTING=On -DBUILD_GUI=On -DWITH_QCHART=On -DBUILD_TRIAGE=On -DUSE_MATCHCOMPILER=Verify -DANALYZE_THREAD=On -DENABLE_CHECK_INTERNAL=On -DUSE_BOOST=On -DCPPCHK_GLIBCXX_DEBUG=Off -DCMAKE_DISABLE_PRECOMPILE_HEADERS=On -DCMAKE_GLOBAL_AUTOGEN_TARGET=Off -DDISABLE_DMAKE=On -DFILESDIR= -DCMAKE_COMPILE_WARNING_AS_ERROR=On -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
77-
env:
78-
CC: clang-22
79-
CXX: clang++-22
80-
81-
- name: Build cppcheck
82-
run: |
83-
cmake --build cmake.output --target cppcheck -- -j $(nproc)
84-
85-
- name: Build test
86-
run: |
87-
cmake --build cmake.output --target testrunner -- -j $(nproc)
88-
89-
- name: Build GUI tests
90-
run: |
91-
cmake --build cmake.output --target gui-tests -- -j $(nproc)
92-
93-
- name: Run tests
94-
run: ./cmake.output/bin/testrunner
95-
96-
- name: Run cfg tests
97-
run: |
98-
cmake --build cmake.output --target checkcfg -- -j $(nproc)
99-
100-
- name: Run CTest
101-
if: false # TODO: test-filelist fails with data race in pthread_cond_destroy
102-
run: |
103-
ctest --test-dir cmake.output --output-on-failure -j$(nproc)
104-
105-
- name: Run test/cli
106-
run: |
107-
pwd=$(pwd)
108-
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
109-
env:
110-
TEST_CPPCHECK_INJECT_EXECUTOR: thread
111-
112-
- name: Run test/cli (-j2)
113-
run: |
114-
pwd=$(pwd)
115-
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
116-
env:
117-
TEST_CPPCHECK_INJECT_J: 2
118-
119-
- name: Run test/cli (--clang)
120-
if: false
121-
run: |
122-
pwd=$(pwd)
123-
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
124-
env:
125-
TEST_CPPCHECK_INJECT_CLANG: clang
126-
127-
- name: Run test/cli (--cppcheck-build-dir)
128-
run: |
129-
pwd=$(pwd)
130-
TEST_CPPCHECK_EXE_LOOKUP_PATH="$pwd/cmake.output" python3 -m pytest -Werror --strict-markers -vv -n auto test/cli
131-
env:
132-
TEST_CPPCHECK_INJECT_BUILDDIR: injected
133-
134-
- name: Generate dependencies
135-
if: false
136-
run: |
137-
# make sure auto-generated GUI files exist
138-
make -C cmake.output autogen
139-
make -C cmake.output gui-build-deps triage-build-ui-deps
140-
141-
# TODO: disabled for now as it takes around 40 minutes to finish
142-
# 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
143-
- name: Self check
144-
if: false
145-
run: |
146-
./selfcheck_san.sh ./cmake.output "--executor=thread --error-exitcode=0"

0 commit comments

Comments
 (0)