Skip to content

Commit f0357c2

Browse files
committed
ci: add sanitizer test matrix
1 parent 99584ab commit f0357c2

1 file changed

Lines changed: 146 additions & 0 deletions

File tree

‎.github/workflows/sanitizers.yml‎

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
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: Setup MSVC developer environment
37+
uses: TheMrMilchmann/setup-msvc-dev@v4
38+
with:
39+
arch: x64
40+
41+
- name: Install Conan
42+
uses: turtlebrowser/get-conan@main
43+
44+
- name: Setup Conan
45+
run: |
46+
conan --version
47+
conan profile detect
48+
49+
- name: Install CMake
50+
uses: lukka/get-cmake@latest
51+
52+
- name: Install dependencies
53+
run: >
54+
conan install .
55+
-c tools.microsoft.msbuild:vs_version=17
56+
-s compiler.version=194
57+
-s compiler.cppstd=23
58+
-s build_type=${{ matrix.build-type }}
59+
-b missing
60+
61+
- name: CMake Configure
62+
run: >
63+
cmake --preset conan-default
64+
-DZEUS_EXPECTED_TEST_ASAN_REQUIRED=ON
65+
66+
- name: Build
67+
run: cmake --build --preset ${{ matrix.cmake-preset }}
68+
69+
- name: Test
70+
run: ctest --preset ${{ matrix.cmake-preset }} --output-on-failure
71+
72+
test-on-linux:
73+
strategy:
74+
fail-fast: false
75+
76+
matrix:
77+
compiler:
78+
- name: GCC 15
79+
id: gcc
80+
version: 15
81+
cc: gcc-15
82+
cxx: g++-15
83+
- name: Clang 22
84+
id: clang
85+
version: 22
86+
cc: clang-22
87+
cxx: clang++-22
88+
build-type: [Debug, Release]
89+
include:
90+
- build-type: Debug
91+
cmake-preset: conan-debug
92+
- build-type: Release
93+
cmake-preset: conan-release
94+
95+
name: ${{ matrix.compiler.name }} - ASan + UBSan - ${{ matrix.build-type }}
96+
97+
runs-on: ubuntu-24.04
98+
99+
env:
100+
CC: ${{ matrix.compiler.cc }}
101+
CXX: ${{ matrix.compiler.cxx }}
102+
103+
steps:
104+
- uses: actions/checkout@v7
105+
106+
- name: Setup GCC
107+
if: matrix.compiler.id == 'gcc'
108+
uses: egor-tensin/setup-gcc@v2
109+
with:
110+
version: ${{ matrix.compiler.version }}
111+
112+
- name: Setup Clang
113+
if: matrix.compiler.id == 'clang'
114+
uses: egor-tensin/setup-clang@v2
115+
with:
116+
version: ${{ matrix.compiler.version }}
117+
118+
- name: Install Conan
119+
uses: turtlebrowser/get-conan@main
120+
121+
- name: Setup Conan
122+
run: |
123+
conan --version
124+
conan profile detect --force
125+
126+
- name: Install CMake
127+
uses: lukka/get-cmake@latest
128+
129+
- name: Install dependencies
130+
run: >
131+
conan install .
132+
-s compiler.cppstd=23
133+
-s build_type=${{ matrix.build-type }}
134+
-b missing
135+
136+
- name: CMake Configure
137+
run: >
138+
cmake --preset ${{ matrix.cmake-preset }}
139+
-DZEUS_EXPECTED_TEST_ASAN_REQUIRED=ON
140+
-DZEUS_EXPECTED_TEST_UBSAN_REQUIRED=ON
141+
142+
- name: Build
143+
run: cmake --build --preset ${{ matrix.cmake-preset }}
144+
145+
- name: Test
146+
run: ctest --preset ${{ matrix.cmake-preset }} --output-on-failure

0 commit comments

Comments
 (0)