Skip to content

Commit fbcc2d9

Browse files
authored
chore(ci): build with sanitizers (#252)
1 parent 2f8323a commit fbcc2d9

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

.github/workflows/dev.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ jobs:
4141
steps:
4242
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4343
- name: Configure
44-
run: bin/with-toolchain ${{ matrix.toolchain }} cmake . -B .build -DCMAKE_BUILD_TYPE=Debug -DDD_TRACE_BUILD_TESTING=1
44+
run: bin/with-toolchain ${{ matrix.toolchain }} cmake . -B .build --preset ci-clang
4545
- name: Build
4646
run: cmake --build ${BUILD_DIR} -j -v
4747
- name: Test
4848
run: cd ${BUILD_DIR} && test/tests -r junit -o report.xml
49+
env:
50+
ASAN_OPTIONS: alloc_dealloc_mismatch=0
4951
- name: Upload test report to Datadog
5052
run: |
5153
curl -L --fail "https://github.com/DataDog/datadog-ci/releases/latest/download/datadog-ci_linux-${{ matrix.arch }}" --output "/usr/local/bin/datadog-ci" && chmod +x /usr/local/bin/datadog-ci
@@ -129,7 +131,7 @@ jobs:
129131
- name: Build
130132
run: |
131133
& 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\Tools\\Launch-VsDevShell.ps1' -arch ${{ matrix.arch }}
132-
cmake --preset=ci-windows -B build -DCMAKE_BUILD_TYPE=Debug .
134+
cmake --preset=ci-msvc -B build -DCMAKE_BUILD_TYPE=Debug .
133135
cmake --build build -j $env:MAKE_JOB_COUNT -v
134136
- name: Test
135137
run: |

CMakePresets.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
"$schema": "https://cmake.org/cmake/help/latest/_downloads/3e2d73bff478d88a7de0de736ba5e361/schema.json",
44
"configurePresets": [
55
{
6-
"name": "ci-windows",
7-
"displayName": "CI Windows",
6+
"name": "ci-msvc",
7+
"displayName": "CI MSVC",
88
"generator": "Ninja",
99
"cacheVariables": {
10-
"CMAKE_COMPILE_WARNING_AS_ERROR": "1",
10+
"CMAKE_COMPILE_WARNING_AS_ERROR": "ON",
1111
"BUILD_SHARED_LIBS": "OFF",
1212
"DD_TRACE_STATIC_CRT": "1",
13-
"DD_TRACE_BUILD_TESTING": "1"
13+
"DD_TRACE_BUILD_TESTING": "ON",
14+
"DD_TRACE_ENABLE_SANITIZE": "ON"
1415
}
1516
},
1617
{
@@ -26,11 +27,20 @@
2627
"cacheVariables": {
2728
"CMAKE_BUILD_TYPE": "Debug",
2829
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
29-
"DD_TRACE_ENABLE_SANITIZE": "OFF",
30+
"DD_TRACE_ENABLE_SANITIZE": "ON",
3031
"DD_TRACE_BUILD_TESTING": "ON",
3132
"DD_TRACE_BUILD_EXAMPLES": "ON",
3233
"DD_TRACE_BUILD_FUZZERS": "OFF"
3334
}
35+
},
36+
{
37+
"name": "ci-clang",
38+
"displayName": "CI Clang",
39+
"cacheVariables": {
40+
"CMAKE_BUILD_TYPE": "Debug",
41+
"DD_TRACE_ENABLE_SANITIZE": "ON",
42+
"DD_TRACE_BUILD_TESTING": "ON"
43+
}
3444
}
3545
]
3646
}

0 commit comments

Comments
 (0)