Skip to content

Commit deb6fda

Browse files
committed
Add a format check to GitHub CI
1 parent 5254f09 commit deb6fda

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/format.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Based on https://dev.to/10xlearner/formatting-cmake-4dle
2+
name: Check formatting
3+
4+
on:
5+
push:
6+
branches: [development, main]
7+
paths-ignore:
8+
- 'README.md'
9+
- 'INSTALL.md'
10+
- 'docs/**'
11+
jobs:
12+
cmake-format:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Install cmake-format
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install cmake_format
20+
- name: Run cmake-format
21+
run: |
22+
find . \( -name '*.cmake' -o -name 'CMakeLists.txt' \) -exec cmake-format -i {} \;
23+
- name: Check format
24+
run: git diff --exit-code

0 commit comments

Comments
 (0)