Skip to content

Commit 2ff6fad

Browse files
committed
ci: speed up clang-tidy workflow
1 parent 149d29c commit 2ff6fad

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

.github/workflows/clang-tidy.yaml

Lines changed: 4 additions & 8 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,13 +61,11 @@ 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+
clang-tidy -p build $(jq -r .[].file build/compile_commands.json) 2>&1 | tee -a clang-tidy.log
7269
7370
- uses: actions/upload-artifact@v4
7471
with:
@@ -77,8 +74,7 @@ jobs:
7774

7875
- name: Count warnings
7976
run: |
80-
cd build
8177
COUNT=$(grep -c "warning:" clang-tidy.log)
8278
echo "clang-tidy reported ${COUNT} warning(s)"
8379
84-
# TODO: include WITH_OTLP_GRPC and WITH_ABSEIL flags.
80+
# TODO: include WITH_OTLP_GRPC and WITH_ABSEIL flags.

0 commit comments

Comments
 (0)