Skip to content

Commit 021ba8b

Browse files
authored
[CI] Add CMake lint job (#474)
- add workflow to lint cmake files using cmake-format - remove duplicate patterns in workflow triggers
1 parent 7c0dcde commit 021ba8b

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/cmake-lint.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CMake Lint
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "**/CMakeLists.txt"
7+
- "**/*.cmake"
8+
push:
9+
paths:
10+
- "**/CMakeLists.txt"
11+
- "**/*.cmake"
12+
workflow_dispatch:
13+
14+
jobs:
15+
cmake-lint:
16+
name: Check CMake formatting
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
- name: Install cmake-format
22+
run: python3 -m pip install cmakelang
23+
- name: Run cmake-format
24+
run: |
25+
files=$(git ls-files '**/CMakeLists.txt' 'cmake/*.cmake')
26+
cmake-format --check $files

0 commit comments

Comments
 (0)