Skip to content

Commit e55c626

Browse files
committed
ci: add sanitizer test matrix
1 parent 6e102fd commit e55c626

1 file changed

Lines changed: 141 additions & 0 deletions

File tree

‎.github/workflows/sanitizers.yml‎

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
name: Sanitizers
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- ci/**
9+
pull_request:
10+
branches:
11+
- main
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
test-on-msvc:
18+
strategy:
19+
fail-fast: false
20+
21+
matrix:
22+
build-type: [Debug, Release]
23+
include:
24+
- build-type: Debug
25+
cmake-preset: conan-debug
26+
- build-type: Release
27+
cmake-preset: conan-release
28+
29+
name: MSVC v143 - ASan - ${{ matrix.build-type }}
30+
31+
runs-on: windows-2022
32+
33+
steps:
34+
- uses: actions/checkout@v7
35+
36+
- name: Install Conan
37+
uses: turtlebrowser/get-conan@main
38+
39+
- name: Setup Conan
40+
run: |
41+
conan --version
42+
conan profile detect
43+
44+
- name: Install CMake
45+
uses: lukka/get-cmake@latest
46+
47+
- name: Install dependencies
48+
run: >
49+
conan install .
50+
-c tools.microsoft.msbuild:vs_version=17
51+
-s compiler.version=194
52+
-s compiler.cppstd=23
53+
-s build_type=${{ matrix.build-type }}
54+
-b missing
55+
56+
- name: CMake Configure
57+
run: >
58+
cmake --preset conan-default
59+
-DZEUS_EXPECTED_TEST_ASAN_REQUIRED=ON
60+
61+
- name: Build
62+
run: cmake --build --preset ${{ matrix.cmake-preset }}
63+
64+
- name: Test
65+
run: ctest --preset ${{ matrix.cmake-preset }} --output-on-failure
66+
67+
test-on-linux:
68+
strategy:
69+
fail-fast: false
70+
71+
matrix:
72+
compiler:
73+
- name: GCC 15
74+
id: gcc
75+
version: 15
76+
cc: gcc-15
77+
cxx: g++-15
78+
- name: Clang 22
79+
id: clang
80+
version: 22
81+
cc: clang-22
82+
cxx: clang++-22
83+
build-type: [Debug, Release]
84+
include:
85+
- build-type: Debug
86+
cmake-preset: conan-debug
87+
- build-type: Release
88+
cmake-preset: conan-release
89+
90+
name: ${{ matrix.compiler.name }} - ASan + UBSan - ${{ matrix.build-type }}
91+
92+
runs-on: ubuntu-24.04
93+
94+
env:
95+
CC: ${{ matrix.compiler.cc }}
96+
CXX: ${{ matrix.compiler.cxx }}
97+
98+
steps:
99+
- uses: actions/checkout@v7
100+
101+
- name: Setup GCC
102+
if: matrix.compiler.id == 'gcc'
103+
uses: egor-tensin/setup-gcc@v2
104+
with:
105+
version: ${{ matrix.compiler.version }}
106+
107+
- name: Setup Clang
108+
if: matrix.compiler.id == 'clang'
109+
uses: egor-tensin/setup-clang@v2
110+
with:
111+
version: ${{ matrix.compiler.version }}
112+
113+
- name: Install Conan
114+
uses: turtlebrowser/get-conan@main
115+
116+
- name: Setup Conan
117+
run: |
118+
conan --version
119+
conan profile detect --force
120+
121+
- name: Install CMake
122+
uses: lukka/get-cmake@latest
123+
124+
- name: Install dependencies
125+
run: >
126+
conan install .
127+
-s compiler.cppstd=23
128+
-s build_type=${{ matrix.build-type }}
129+
-b missing
130+
131+
- name: CMake Configure
132+
run: >
133+
cmake --preset ${{ matrix.cmake-preset }}
134+
-DZEUS_EXPECTED_TEST_ASAN_REQUIRED=ON
135+
-DZEUS_EXPECTED_TEST_UBSAN_REQUIRED=ON
136+
137+
- name: Build
138+
run: cmake --build --preset ${{ matrix.cmake-preset }}
139+
140+
- name: Test
141+
run: ctest --preset ${{ matrix.cmake-preset }} --output-on-failure

0 commit comments

Comments
 (0)