Skip to content
Closed
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
47 changes: 47 additions & 0 deletions .github/workflows/clang_tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: clang-tidy

on:
workflow_dispatch:

pull_request:
branches: [main]
# paths: ['**.c', '**.cpp', '**.h', '**.hpp', '**.cxx', '**.hxx', '**.cc', '**.hh', '**CMakeLists.txt', '**.cmake']

jobs:
clang-tidy:
runs-on: windows-latest

# Set required permissions if using thread comments or PR reviews
permissions:
contents: read
pull-requests: write

steps:
- name: Checkout Repository
uses: actions/checkout@v7
with:
submodules: recursive

- name: Set up vcpkg
uses: lukka/run-vcpkg@v11

- name: Configure CMake
# -DCMAKE_EXPORT_COMPILE_COMMANDS=ON tells CMake to create compile_commands.json
run: cmake -B build -S . --preset x64-windows-release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON

- name: Run clang-tidy
uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: '' # Disable clang-format for this clang-tidy-only workflow
# Point the action to the database generated by CMake in the 'build' folder
database: 'build'
thread-comments: true

- name: Fail workflow if checks failed
if: steps.linter.outputs.checks-failed != 0
run: |
echo "Linter detected clang-tidy errors."
exit 1
Loading