Skip to content

Commit 53141cd

Browse files
committed
ci: Move clang-tidy settings to CMakePresets.json
Allows users to run locally with the same settings and makes the yml file cleaner
1 parent e294475 commit 53141cd

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

.github/workflows/tidyclazy.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,11 @@ jobs:
2727

2828
config:
2929
- name: clang-tidy
30-
# To be moved to a cmake preset
31-
cmake_arg: "-DCMAKE_CXX_CLANG_TIDY=clang-tidy -B ./build -G Ninja --warn-uninitialized -Werror=dev -DCMAKE_BUILD_TYPE=Debug -DKDSoap_QT6=ON -DKDSoap_TESTS=ON"
32-
cmake_build_arg: "./build"
30+
preset: "clang-tidy"
3331
qt_version: "6.6"
3432

3533
- name: clazy
36-
cmake_arg: "--preset=clazy"
37-
cmake_build_arg: "--preset=clazy"
34+
preset: "clazy"
3835
qt_version: "6.6"
3936
apt_pgks:
4037
- clazy
@@ -64,7 +61,7 @@ jobs:
6461

6562
- name: Configure project
6663
run: >
67-
cmake -S . ${{ matrix.config.cmake_arg }}
64+
cmake --preset=${{ matrix.config.preset }}
6865
6966
- name: Build Project
70-
run: cmake --build ${{ matrix.config.cmake_build_arg }}
67+
run: cmake --build --preset=${{ matrix.config.preset }}

CMakePresets.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,15 @@
6262
"CCACHE_DISABLE": "ON"
6363
}
6464
},
65+
{
66+
"name": "clang-tidy",
67+
"inherits": "dev",
68+
"cacheVariables": {
69+
"KDSoap_EXAMPLES": "OFF",
70+
"KDSoap_TESTS": "OFF",
71+
"CMAKE_CXX_CLANG_TIDY": "clang-tidy"
72+
}
73+
},
6574
{
6675
"name": "release",
6776
"inherits": "base",
@@ -86,6 +95,10 @@
8695
"CCACHE_DISABLE": "ON",
8796
"CLAZY_IGNORE_DIRS": ".*libkode.*"
8897
}
98+
},
99+
{
100+
"name": "clang-tidy",
101+
"configurePreset": "clang-tidy"
89102
}
90103
]
91104
}

0 commit comments

Comments
 (0)