Skip to content

Commit

Permalink
[CI] speed up clang-tidy workflow (open-telemetry#3148)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjinks authored Nov 15, 2024
1 parent 149d29c commit a388e87
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/clang-tidy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ jobs:
CC: clang
CXX: clang++
run: |
mkdir -p build && cd build
echo "Running cmake..."
cmake .. \
cmake -B build \
-DCMAKE_CXX_STANDARD=14 \
-DWITH_STL=CXX14 \
-DWITH_OTLP_HTTP=ON \
Expand All @@ -62,23 +61,21 @@ jobs:
-DBUILD_W3CTRACECONTEXT_TEST=ON \
-DWITH_METRICS_EXEMPLAR_PREVIEW=ON \
-DWITH_ASYNC_EXPORT_PREVIEW=ON \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_CXX_CLANG_TIDY="clang-tidy"
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Run clang-tidy
run: |
cd build
make 2>&1 | tee -a clang-tidy.log || exit 1
cmake --build build --target opentelemetry_proto
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
- uses: actions/upload-artifact@v4
with:
name: Logs (clang-tidy)
path: ./build/clang-tidy.log
path: ./clang-tidy.log

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

0 comments on commit a388e87

Please sign in to comment.