Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] speed up clang-tidy workflow #3148

Merged
merged 4 commits into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.