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
53 changes: 53 additions & 0 deletions .github/workflows/clang_tidy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Clang Tidy Linting

on:
push:
workflow_dispatch:

permissions:
contents: read
packages: read

jobs:
clang-tidy-linting:
runs-on: ubuntu-latest

container:
image: ghcr.io/hardcode3/bitbishop-ubuntu:latest
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}

steps:
- uses: actions/checkout@v4

- name: Install clang-tidy
run: |
apt-get update
apt-get install -y clang-tidy

- name: Configure (clang_debug)
run: cmake --preset clang_debug

- name: Run clang-tidy
shell: bash
run: |
set +e
cmake --build --preset clang_debug --target clang-tidy 2>&1 | tee clang_tidy_output.txt
CLANG_TIDY_EXIT_CODE=${PIPESTATUS[0]} # Capture CMake exit code, not tee
set -e

if [ $CLANG_TIDY_EXIT_CODE -eq 0 ]; then
echo "<details><summary>🟢 Clang Tidy Results (click to expand)</summary>" >> $GITHUB_STEP_SUMMARY
else
echo "## 🔴 Clang Tidy Results" >> $GITHUB_STEP_SUMMARY
fi
echo '' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
cat clang_tidy_output.txt >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
if [ $CLANG_TIDY_EXIT_CODE -eq 0 ]; then
echo "</details>" >> $GITHUB_STEP_SUMMARY
fi

exit $CLANG_TIDY_EXIT_CODE
Loading