Skip to content

Commit a2851c2

Browse files
committed
disable deprecation warnings with clang-tidy jobs. Disable clang-tidy for protobuf generated code. Run iwyu in parallel.
1 parent aad7ac8 commit a2851c2

File tree

9 files changed

+23
-26
lines changed

9 files changed

+23
-26
lines changed

.github/workflows/clang-tidy.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
clang-tidy:
1414
runs-on: ubuntu-24.04
1515
strategy:
16-
fail-fast: true
16+
fail-fast: false
1717
matrix:
1818
include:
1919
- cmake_options: all-options-abiv1-preview
@@ -31,10 +31,6 @@ jobs:
3131
submodules: recursive
3232

3333
- name: Setup Environment
34-
env:
35-
PROTOBUF_VERSION: '23.3'
36-
ABSEIL_CPP_VERSION: '20230125.3'
37-
CXX_STANDARD: '14'
3834
run: |
3935
sudo apt update -y
4036
sudo apt install -y --no-install-recommends --no-install-suggests \
@@ -71,6 +67,7 @@ jobs:
7167
-DCMAKE_CXX_STANDARD=14 \
7268
-DWITH_STL=CXX14 \
7369
-DWITH_OPENTRACING=OFF \
70+
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
7471
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
7572
-DCMAKE_CXX_CLANG_TIDY="clang-tidy;--quiet;-p;build-${{ matrix.cmake_options }}"
7673
@@ -85,7 +82,6 @@ jobs:
8582

8683
- name: Count warnings
8784
run: |
88-
clang-tidy --version
8985
COUNT=$(grep -c "warning:" clang-tidy-${{ matrix.cmake_options }}.log)
9086
echo "clang-tidy reported ${COUNT} warning(s) with cmake options preset '${{ matrix.cmake_options }}'"
9187

.github/workflows/iwyu.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
iwyu:
1515
runs-on: ubuntu-latest
1616
strategy:
17-
fail-fast: true
17+
fail-fast: false
1818
matrix:
1919
include:
2020
- cmake_options: all-options-abiv1
@@ -57,26 +57,26 @@ jobs:
5757
run: |
5858
sudo ./ci/install_iwyu.sh
5959
- name: Prepare CMake
60+
env:
61+
CC: clang
62+
CXX: clang++
6063
run: |
6164
TOPDIR=`pwd`
62-
mkdir -p build-${{ matrix.cmake_options }} && cd build-${{ matrix.cmake_options }}
63-
CC="clang" CXX="clang++" cmake \
64-
-C ${TOPDIR}/test_common/cmake/${{ matrix.cmake_options }}.cmake \
65+
cmake -B build-${{ matrix.cmake_options }} \
66+
-C ./test_common/cmake/${{ matrix.cmake_options }}.cmake \
6567
-DCMAKE_CXX_STANDARD=14 \
6668
-DWITH_STL=CXX14 \
67-
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \
68-
..
69+
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;"
6970
7071
- name: iwyu_tool
7172
run: |
72-
cd build-${{ matrix.cmake_options }}
73-
make -k 2>&1 | tee -a iwyu-${{ matrix.cmake_options }}.log
73+
cmake --build build-${{ matrix.cmake_options }} -- -j$(nproc) -k 2>&1 | tee -a iwyu-${{ matrix.cmake_options }}.log
7474
7575
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
7676
if: success() || failure()
7777
with:
7878
name: Logs-iwyu-${{ matrix.cmake_options }}
79-
path: ./build-${{ matrix.cmake_options }}/*.log
79+
path: ./iwyu-${{ matrix.cmake_options }}.log
8080

8181
- name: count warnings
8282
run: |

cmake/opentelemetry-proto.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ target_include_directories(
318318
PUBLIC "$<BUILD_INTERFACE:${GENERATED_PROTOBUF_PATH}>"
319319
"$<INSTALL_INTERFACE:include>")
320320

321-
# Disable include-what-you-use on generated code.
321+
# Disable include-what-you-use and clang-tidy on generated code.
322322
set_target_properties(opentelemetry_proto PROPERTIES CXX_INCLUDE_WHAT_YOU_USE
323-
"")
323+
"" CXX_CLANG_TIDY "")
324324
if(NOT Protobuf_INCLUDE_DIRS AND TARGET protobuf::libprotobuf)
325325
get_target_property(Protobuf_INCLUDE_DIRS protobuf::libprotobuf
326326
INTERFACE_INCLUDE_DIRECTORIES)
@@ -338,9 +338,9 @@ if(WITH_OTLP_GRPC)
338338
${LOGS_SERVICE_GRPC_PB_CPP_FILE} ${METRICS_SERVICE_GRPC_PB_CPP_FILE})
339339
set_target_version(opentelemetry_proto_grpc)
340340

341-
# Disable include-what-you-use on generated code.
341+
# Disable include-what-you-use and clang-tidy on generated code.
342342
set_target_properties(opentelemetry_proto_grpc
343-
PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "")
343+
PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "" CXX_CLANG_TIDY "")
344344

345345
list(APPEND OPENTELEMETRY_PROTO_TARGETS opentelemetry_proto_grpc)
346346
target_link_libraries(opentelemetry_proto_grpc PUBLIC opentelemetry_proto)

examples/grpc/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ add_custom_command(
4141
add_library(example_grpc_proto ${example_grpc_srcs} ${example_grpc_hdrs}
4242
${example_proto_srcs} ${example_proto_hdrs})
4343

44-
# Disable include-what-you-use on generated code.
45-
set_target_properties(example_grpc_proto PROPERTIES CXX_INCLUDE_WHAT_YOU_USE "")
44+
# Disable include-what-you-use and clang-tidy on generated code.
45+
set_target_properties(example_grpc_proto PROPERTIES CXX_INCLUDE_WHAT_YOU_USE ""
46+
CXX_CLANG_TIDY "")
4647

4748
target_include_directories(
4849
example_grpc_proto PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>")

test_common/cmake/all-options.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
# Enable all options for opentelemetry-cpp cmake.
4+
# All options for the opentelemetry-cpp project.
55

66
include(${CMAKE_CURRENT_LIST_DIR}/component-options.cmake)
77
include(${CMAKE_CURRENT_LIST_DIR}/example-options.cmake)

test_common/cmake/component-options.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
# Enable all components in the OpenTelemetry C++ SDK.
4+
# All components options
55

66
if(NOT DEFINED ENABLE_COMPONENTS)
77
set(ENABLE_COMPONENTS ON)

test_common/cmake/example-options.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
# Enable all examples in the OpenTelemetry C++ SDK.
4+
# All examples options
55

66
if(NOT DEFINED ENABLE_EXAMPLES)
77
set(ENABLE_EXAMPLES ON)

test_common/cmake/preview-options.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
# Enable all preview features in the OpenTelemetry C++ SDK.
4+
# All preview feature options
55

66
if(NOT DEFINED ENABLE_PREVIEW)
77
set(ENABLE_PREVIEW ON)

test_common/cmake/testing-options.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
# Enable all tests in the OpenTelemetry C++ SDK.
4+
# All testing options
55

66
if(NOT DEFINED ENABLE_TESTS)
77
set(ENABLE_TESTS ON)

0 commit comments

Comments
 (0)