Skip to content

Commit a388e87

Browse files
authored
[CI] speed up clang-tidy workflow (#3148)
1 parent 149d29c commit a388e87

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

.github/workflows/clang-tidy.yaml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ jobs:
4646
CC: clang
4747
CXX: clang++
4848
run: |
49-
mkdir -p build && cd build
5049
echo "Running cmake..."
51-
cmake .. \
50+
cmake -B build \
5251
-DCMAKE_CXX_STANDARD=14 \
5352
-DWITH_STL=CXX14 \
5453
-DWITH_OTLP_HTTP=ON \
@@ -62,23 +61,21 @@ jobs:
6261
-DBUILD_W3CTRACECONTEXT_TEST=ON \
6362
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
6463
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
65-
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
66-
-DCMAKE_CXX_CLANG_TIDY="clang-tidy"
64+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
6765
6866
- name: Run clang-tidy
6967
run: |
70-
cd build
71-
make 2>&1 | tee -a clang-tidy.log || exit 1
68+
cmake --build build --target opentelemetry_proto
69+
jq -r .[].file build/compile_commands.json | grep -vE '/(generated|third_party)/' | xargs -P $(nproc) -n 1 clang-tidy --quiet -p build 2>&1 | tee -a clang-tidy.log
7270
7371
- uses: actions/upload-artifact@v4
7472
with:
7573
name: Logs (clang-tidy)
76-
path: ./build/clang-tidy.log
74+
path: ./clang-tidy.log
7775

7876
- name: Count warnings
7977
run: |
80-
cd build
8178
COUNT=$(grep -c "warning:" clang-tidy.log)
8279
echo "clang-tidy reported ${COUNT} warning(s)"
8380
84-
# TODO: include WITH_OTLP_GRPC and WITH_ABSEIL flags.
81+
# TODO: include WITH_OTLP_GRPC and WITH_ABSEIL flags.

0 commit comments

Comments
 (0)