Skip to content

Commit

Permalink
ci: Add clang-tidy
Browse files Browse the repository at this point in the history
Removed AnalyzeTemporaryDtors since that option has been removed
from clang-tidy.

workflow needs to be triggered manually while we're not clang-tidy
clean
  • Loading branch information
iamsergio committed Jan 20, 2025
1 parent 64d8169 commit 5c6fa60
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 1 deletion.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ Checks:

WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false

CheckOptions:
- key: cert-oop11-cpp.UseCERTSemantics
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only

name: clang-tidy

on:
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu-24.04
steps:
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.6
cache: true

- name: Install dependencies on Ubuntu
run: |
sudo apt update -qq
sudo apt install llvm ninja-build -y
- uses: actions/checkout@v4

- name: Configure project
run: cmake -S . -B ./build-tidy --preset clang-tidy

- name: clang-tidy
run: cmake --build ./build-tidy
24 changes: 24 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,30 @@
"clazy-no-werror",
"base6"
]
},
{
"name": "clang-tidy",
"binaryDir": "${sourceDir}/build-clang-tidy",
"inherits": [
"base6"
],
"cacheVariables": {
"CMAKE_CXX_CLANG_TIDY": "clang-tidy;--warnings-as-errors=*",
"KDToolBars_TESTS": "OFF",
"KDToolBars_EXAMPLES": "OFF"
}
},
{
"name": "clang-tidy-no-werror",
"binaryDir": "${sourceDir}/build-clang-tidy-no-werror",
"inherits": [
"base6"
],
"cacheVariables": {
"CMAKE_CXX_CLANG_TIDY": "clang-tidy",
"KDToolBars_TESTS": "OFF",
"KDToolBars_EXAMPLES": "OFF"
}
}
],
"buildPresets": [
Expand Down

0 comments on commit 5c6fa60

Please sign in to comment.