-
Notifications
You must be signed in to change notification settings - Fork 0
32 lines (30 loc) · 1.05 KB
/
format.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name: "C++/CMake Format"
on:
push:
paths-ignore:
- 'README.md'
jobs:
format:
name: "clang-format/cmake-format"
runs-on: 'alpine:latest'
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apk update
sudo apk add \
clang-extra-tools \
py3-pip
pip install --break-system-packages cmake-format
# Check all source and header C++ files; ignore files in hidden directories
- name: Execute clang-format
run: find . \( -path '*/.*' -prune \) -o
\( -type f -a \( -iname '*.cpp' -o -iname '*.h' \) \)
-exec echo "Format checking '{}'..." \;
-exec clang-format --dry-run --Werror --Wno-error=unknown {} +
# Check all cmake files; ignore files in hidden directories
- name: Execute cmake-format
run: find . \( -path '*/.*' -prune \) -o
\( -type f -a -name 'CMakeLists.txt' \)
-exec echo "Format checking '{}'..." \;
-exec cmake-format --check -- {} +