Skip to content
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
14 changes: 12 additions & 2 deletions .github/workflows/clang-tidy-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,18 @@ jobs:
cd "$GITHUB_WORKSPACE/phlex-build"

echo "➡️ Running clang-tidy checks..."
cmake --build . --target clang-tidy-check -- --export-fixes clang-tidy-fixes.yaml > clang-tidy.log 2>&1 || true
if [ -s clang-tidy-fixes.yaml ]; then
cmake_status=0
cmake --build . --target clang-tidy-check -- --export-fixes clang-tidy-fixes.yaml > clang-tidy.log 2>&1 || cmake_status=$?

# Distinguish tooling failures from issue detection by checking log content
if [ "$cmake_status" -ne 0 ]; then
if ! grep -qE '^/.+\.(cpp|hpp|c|h):[0-9]+:[0-9]+: (warning|error):' clang-tidy.log; then
echo "::error::clang-tidy failed without producing diagnostic output (exit code $cmake_status)"
exit "$cmake_status"
fi
fi

if grep -qE '^/.+\.(cpp|hpp|c|h):[0-9]+:[0-9]+: (warning|error):' clang-tidy.log; then
echo "has_issues=true" >> "$GITHUB_OUTPUT"
echo "::warning::Clang-tidy found issues in the code"
echo "Error count by check (full details in clang-tidy-log artifact):"
Expand Down
Loading