Skip to content

Commit 874adb3

Browse files
authored
Merge pull request #202 from Sichao25/yus/reformat
Downgrade cmake-format to 0.6.11 in CI
2 parents 3d5ab85 + 6501e70 commit 874adb3

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

.github/workflows/format-check.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,17 @@ on:
77
branches: [ develop ]
88

99
jobs:
10-
format-check:
10+
clang-format-check:
1111
runs-on: ubuntu-latest
1212

1313
steps:
1414
- name: Checkout code
1515
uses: actions/checkout@v3
1616

17-
- name: Set up Python
18-
uses: actions/setup-python@v4
19-
with:
20-
python-version: '3.10'
21-
2217
- name: Install clang-format
2318
run: |
2419
sudo apt-get update
2520
sudo apt-get install -y clang-format-18
26-
27-
- name: Install cmake-format
28-
run: pip install PyYAML cmake-format==0.6.13
2921
3022
- name: Check C++ code format
3123
run: |
@@ -38,23 +30,39 @@ jobs:
3830
fi
3931
done < <(find . -name "*.cpp" -o -name "*.hpp" -o -name "*.c" -o -name "*.h" -o -name "*.cc" -o -name "*.cxx")
4032
if [ $EXIT_CODE -eq 1 ]; then
41-
echo "Some C/C++ files are not properly formatted"
33+
echo "Some C/C++ files are not properly formatted. Reformat with clang-format-18."
4234
exit 1
4335
fi
4436
echo "All C/C++ files are properly formatted"
37+
38+
cmake-format-check:
39+
runs-on: ubuntu-latest
40+
41+
steps:
42+
- name: Checkout code
43+
uses: actions/checkout@v3
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@v4
47+
with:
48+
python-version: '3.10'
49+
50+
- name: Install cmake-format
51+
run: |
52+
pip install PyYAML cmake-format==0.6.11
4553
4654
- name: Check CMake code format
4755
run: |
4856
EXIT_CODE=0
4957
while read file; do
50-
if ! cmake-format --check "$file"; then
51-
echo "$file is not properly formatted. Reformat with clang-format-18."
58+
if ! cmake-format --check -c .cmake-format.yaml "$file"; then
59+
echo "$file is not properly formatted"
5260
echo "Run: cmake-format -i $file"
5361
EXIT_CODE=1
5462
fi
5563
done < <(find . -name "CMakeLists.txt" -o -name "*.cmake")
5664
if [ $EXIT_CODE -eq 1 ]; then
57-
echo "Some CMake files are not properly formatted. Reformat with cmake-format 0.6.13."
65+
echo "Some CMake files are not properly formatted. Reformat with cmake-format 0.6.11"
5866
exit 1
5967
fi
60-
echo "All CMake files are properly formatted"
68+
echo "All CMake files are properly formatted"

0 commit comments

Comments
 (0)