Skip to content

Commit 4f16996

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

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/format.yml

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

0 commit comments

Comments
 (0)