Skip to content

Commit e807e3b

Browse files
committed
set fail-fast false on the strategy to get current warning counts. Clean up comments and fix issue with clang-tidy log upload
1 parent 13149e4 commit e807e3b

File tree

9 files changed

+41
-37
lines changed

9 files changed

+41
-37
lines changed

.github/workflows/clang-tidy.yaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ jobs:
1313
clang-tidy:
1414
runs-on: ubuntu-24.04
1515
strategy:
16+
fail-fast: false
1617
matrix:
1718
include:
18-
- options_preset: all-options-abiv1-preview
19+
- cmake_options: all-options-abiv1-preview
1920
warning_limit: 0
20-
- options_preset: all-options-abiv2-preview
21+
- cmake_options: all-options-abiv2-preview
2122
warning_limit: 216
2223
steps:
2324
- name: Harden the runner (Audit all outbound calls)
@@ -66,36 +67,36 @@ jobs:
6667
CXX: clang++
6768
run: |
6869
echo "Running cmake..."
69-
cmake -B build-${{ matrix.options_preset }} \
70-
-C ./test_common/cmake/${{ matrix.options_preset }}.cmake \
70+
cmake -B build-${{ matrix.cmake_options }} \
71+
-C ./test_common/cmake/${{ matrix.cmake_options }}.cmake \
7172
-DCMAKE_CXX_STANDARD=14 \
7273
-DWITH_STL=CXX14 \
7374
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
7475
7576
- name: Run clang-tidy
7677
run: |
77-
cmake --build build-${{ matrix.options_preset }} --target opentelemetry_proto
78-
jq -r .[].file build-${{ matrix.options_preset }}/compile_commands.json | grep -vE '/(generated|third_party)/' | xargs -P $(nproc) -n 1 clang-tidy --quiet -p build-${{ matrix.options_preset }} 2>&1 | tee -a clang-tidy-${{ matrix.options_preset }}.log
78+
cmake --build build-${{ matrix.cmake_options }}
79+
jq -r .[].file build-${{ matrix.cmake_options }}/compile_commands.json | grep -vE '/(generated|third_party)/' | xargs -P $(nproc) -n 1 clang-tidy --quiet -p build-${{ matrix.cmake_options }} 2>&1 | tee -a clang-tidy-${{ matrix.cmake_options }}.log
7980
8081
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
8182
with:
82-
name: Logs (clang-tidy)
83-
path: ./clang-tidy-${{ matrix.options_preset }}.log
83+
name: Logs-clang-tidy-${{ matrix.cmake_options }}
84+
path: ./clang-tidy-${{ matrix.cmake_options }}.log
8485

8586
- name: Count warnings
8687
run: |
8788
clang-tidy --version
88-
COUNT=$(grep -c "warning:" clang-tidy-${{ matrix.options_preset }}.log)
89-
echo "clang-tidy reported ${COUNT} warning(s) with cmake options preset '${{ matrix.options_preset }}'"
89+
COUNT=$(grep -c "warning:" clang-tidy-${{ matrix.cmake_options }}.log)
90+
echo "clang-tidy reported ${COUNT} warning(s) with cmake options preset '${{ matrix.cmake_options }}'"
9091
9192
readonly WARNING_LIMIT=${{ matrix.warning_limit }}
9293
9394
# FAIL the build if COUNT > WARNING_LIMIT
9495
if [ $COUNT -gt $WARNING_LIMIT ] ; then
95-
echo "clang-tidy reported ${COUNT} warning(s) exceeding the existing warning limit of ${WARNING_LIMIT} with cmake options preset '${{ matrix.options_preset }}'"
96+
echo "clang-tidy reported ${COUNT} warning(s) exceeding the existing warning limit of ${WARNING_LIMIT} with cmake options preset '${{ matrix.cmake_options }}'"
9697
exit 1
9798
# WARN in annotations if COUNT > 0
9899
elif [ $COUNT -gt 0 ] ; then
99-
echo "::warning::clang-tidy reported ${COUNT} warning(s) with cmake options preset '${{ matrix.options_preset }}'"
100+
echo "::warning::clang-tidy reported ${COUNT} warning(s) with cmake options preset '${{ matrix.cmake_options }}'"
100101
fi
101102

.github/workflows/iwyu.yml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ jobs:
1414
iwyu:
1515
runs-on: ubuntu-latest
1616
strategy:
17+
fail-fast: false
1718
matrix:
1819
include:
19-
- options_preset: all-options-abiv1
20-
warning_limit: 0
21-
- options_preset: all-options-abiv1-preview
22-
warning_limit: 24
23-
- options_preset: all-options-abiv2-preview
20+
- cmake_options: all-options-abiv1
21+
warning_limit: 3
22+
- cmake_options: all-options-abiv1-preview
23+
warning_limit: 48
24+
- cmake_options: all-options-abiv2-preview
2425
warning_limit: 48
2526

2627
steps:
@@ -58,40 +59,40 @@ jobs:
5859
- name: Prepare CMake
5960
run: |
6061
TOPDIR=`pwd`
61-
mkdir -p build-${{ matrix.options_preset }} && cd build-${{ matrix.options_preset }}
62+
mkdir -p build-${{ matrix.cmake_options }} && cd build-${{ matrix.cmake_options }}
6263
CC="clang" CXX="clang++" cmake \
63-
-C ${TOPDIR}/test_common/cmake/${{ matrix.options_preset }}.cmake \
64+
-C ${TOPDIR}/test_common/cmake/${{ matrix.cmake_options }}.cmake \
6465
-DCMAKE_CXX_STANDARD=14 \
6566
-DWITH_STL=CXX14 \
6667
-DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="include-what-you-use;-w;-Xiwyu;--mapping_file=${TOPDIR}/.iwyu.imp;" \
6768
..
6869
6970
- name: iwyu_tool
7071
run: |
71-
cd build-${{ matrix.options_preset }}
72-
make -k 2>&1 | tee -a iwyu-${{ matrix.options_preset }}.log
72+
cd build-${{ matrix.cmake_options }}
73+
make -k 2>&1 | tee -a iwyu-${{ matrix.cmake_options }}.log
7374
7475
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
7576
if: success() || failure()
7677
with:
77-
name: Logs-${{ matrix.options_preset }} (include-what-you-use)
78-
path: ./build-${{ matrix.options_preset }}/*.log
78+
name: Logs-iwyu-${{ matrix.cmake_options }}
79+
path: ./build-${{ matrix.cmake_options }}/*.log
7980

8081
- name: count warnings
8182
run: |
8283
set +e
8384
echo "include-what-you-use version:"
8485
include-what-you-use --version
85-
cd build-${{ matrix.options_preset }}
86-
readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu-${{ matrix.options_preset }}.log`
87-
echo "include-what-you-use reported ${WARNING_COUNT} warning(s) with cmake options preset '${{ matrix.options_preset }}'"
86+
cd build-${{ matrix.cmake_options }}
87+
readonly WARNING_COUNT=`grep -c "include-what-you-use reported diagnostics:" iwyu-${{ matrix.cmake_options }}.log`
88+
echo "include-what-you-use reported ${WARNING_COUNT} warning(s) with cmake options preset '${{ matrix.cmake_options }}'"
8889
# Acceptable limit, to decrease over time down to 0
8990
readonly WARNING_LIMIT=${{ matrix.warning_limit }}
9091
# FAIL the build if WARNING_COUNT > WARNING_LIMIT
9192
if [ $WARNING_COUNT -gt $WARNING_LIMIT ] ; then
92-
echo "include-what-you-use reported ${WARNING_COUNT} warning(s) exceeding the existing warning limit of ${WARNING_LIMIT} with cmake options preset '${{ matrix.options_preset }}'"
93+
echo "include-what-you-use reported ${WARNING_COUNT} warning(s) exceeding the existing warning limit of ${WARNING_LIMIT} with cmake options preset '${{ matrix.cmake_options }}'"
9394
exit 1
9495
# WARN in annotations if WARNING_COUNT > 0
9596
elif [ $WARNING_COUNT -gt 0 ] ; then
96-
echo "::warning::include-what-you-use reported ${WARNING_COUNT} warning(s) with cmake options preset '${{ matrix.options_preset }}'"
97+
echo "::warning::include-what-you-use reported ${WARNING_COUNT} warning(s) with cmake options preset '${{ matrix.cmake_options }}'"
9798
fi
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
# This script enables ABI V1 with preview features
4+
# Enable all options with ABI V1 including preview features
55

66
set(WITH_ABI_VERSION_1 ON CACHE BOOL "" FORCE)
77
set(WITH_ABI_VERSION_2 OFF CACHE BOOL "" FORCE)
88

99
set(ENABLE_PREVIEW ON)
10-
include(${CMAKE_CURRENT_LIST_DIR}/all-options.cmake)
10+
include(${CMAKE_CURRENT_LIST_DIR}/all-options.cmake)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
# This script enables ABI V1 with all options except preview features
4+
# Enable all options with ABI V1 except preview features
55

66
set(WITH_ABI_VERSION_1 ON CACHE BOOL "" FORCE)
77
set(WITH_ABI_VERSION_2 OFF CACHE BOOL "" FORCE)
88

99
set(ENABLE_PREVIEW OFF)
10-
include(${CMAKE_CURRENT_LIST_DIR}/all-options.cmake)
10+
include(${CMAKE_CURRENT_LIST_DIR}/all-options.cmake)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4-
# This script enables ABI V2 with all options and with preview features
4+
# Enable all options with ABI V2 including preview features
55

66
set(WITH_ABI_VERSION_1 OFF CACHE BOOL "" FORCE)
77
set(WITH_ABI_VERSION_2 ON CACHE BOOL "" FORCE)
88

99
set(ENABLE_PREVIEW ON)
10-
include(${CMAKE_CURRENT_LIST_DIR}/all-options.cmake)
10+
include(${CMAKE_CURRENT_LIST_DIR}/all-options.cmake)

test_common/cmake/all-options-abiv2.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-
# This script enables ABI V2 with all options except preview features
4+
# Enable all options with ABI V2 except preview features
55

66
set(WITH_ABI_VERSION_1 OFF CACHE BOOL "" FORCE)
77
set(WITH_ABI_VERSION_2 ON CACHE BOOL "" FORCE)

test_common/cmake/all-options.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Copyright The OpenTelemetry Authors
22
# SPDX-License-Identifier: Apache-2.0
33

4+
# Enable all options for opentelemetry-cpp cmake.
5+
46
include(${CMAKE_CURRENT_LIST_DIR}/component-options.cmake)
57
include(${CMAKE_CURRENT_LIST_DIR}/example-options.cmake)
68
include(${CMAKE_CURRENT_LIST_DIR}/testing-options.cmake)

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-
# This script enables preview features in the OpenTelemetry C++ SDK.
4+
# Enable all preview features in the OpenTelemetry C++ SDK.
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 examples in the OpenTelemetry C++ SDK.
4+
# Enable all tests in the OpenTelemetry C++ SDK.
55

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

0 commit comments

Comments
 (0)