Skip to content

Commit 96e5876

Browse files
ci(profiling): add a clang-tidy check
1 parent c6edb37 commit 96e5876

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

.gitlab/native.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,22 @@ include:
2121
echo -e "\e[0Ksection_start:`date +%s`:cargo_test[collapsed=true]\r\e[0Kcargo test"
2222
cargo test --no-fail-fast --locked
2323
echo -e "\e[0Ksection_end:`date +%s`:cargo_test\r\e[0K"
24+
25+
"clang-tidy profiling":
26+
stage: tests
27+
image: registry.ddbuild.io/images/mirror/ubuntu:25.04
28+
tags: ["arch:amd64"]
29+
timeout: 20m
30+
needs: []
31+
before_script:
32+
- apt-get update && apt-get install -y clang clang-tidy cmake bc python3 python3-pip python3-venv curl
33+
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y
34+
- source "$HOME/.cargo/env"
35+
- python3 -m venv /tmp/venv
36+
- source /tmp/venv/bin/activate
37+
- python3 -m pip install setuptools wheel cmake setuptools_rust cython wrapt bytecode envier lz4 grpcio protobuf
38+
script:
39+
- |
40+
echo -e "\e[0Ksection_start:`date +%s`:clang_tidy_build[collapsed=true]\r\e[0Kclang-tidy on profiling C++ code"
41+
ddtrace/internal/datadog/profiling/build_standalone.sh --clangtidy Debug all
42+
echo -e "\e[0Ksection_end:`date +%s`:clang_tidy_build\r\e[0K"

ddtrace/internal/datadog/profiling/stack/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ set_target_properties(
3939
include(FetchContent)
4040
include(AnalysisFunc)
4141
include(FindCppcheck)
42+
include(FindClangtidy)
4243

4344
find_package(Python3 COMPONENTS Interpreter Development)
4445

@@ -71,6 +72,9 @@ add_cppcheck_target(
7172
SRC
7273
${CMAKE_CURRENT_SOURCE_DIR}/src)
7374

75+
# Static analysis
76+
add_clangtidy_target(${EXTENSION_NAME})
77+
7478
# Never build with native unwinding, since this is not currently used
7579
target_compile_definitions(${EXTENSION_NAME} PRIVATE UNWIND_NATIVE_DISABLE)
7680

0 commit comments

Comments
 (0)