Skip to content

Commit e67c447

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

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/format.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
pull_request:
12+
branches: [development, main]
13+
paths-ignore:
14+
- 'README.md'
15+
- 'INSTALL.md'
16+
- 'docs/**'
17+
jobs:
18+
cmake-format:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Install cmake-format
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install cmake_format
26+
- name: Run cmake-format
27+
run: |
28+
find . \( -name '*.cmake' -o -name 'CMakeLists.txt' \) -exec cmake-format -i {} \;
29+
- name: Check format
30+
run: git diff --exit-code

0 commit comments

Comments
 (0)