Skip to content

Commit 944c10f

Browse files
committed
Update workflow.
Signed-off-by: iabdalkader <[email protected]>
1 parent 5b1347e commit 944c10f

File tree

1 file changed

+14
-33
lines changed

1 file changed

+14
-33
lines changed

.github/workflows/format_check.yml

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -34,44 +34,25 @@ on:
3434
jobs:
3535
format-check:
3636
runs-on: ubuntu-latest
37+
strategy:
38+
matrix:
39+
path:
40+
- check: '^cores/arduino/'
41+
exclude: '^cores/arduino/api/'
42+
- check: '^loader/'
43+
exclude: 'loader/llext_exports\.c$'
44+
- check: '^libraries/'
45+
exclude: '^libraries/ea_malloc/'
3746
steps:
3847
- name: Checkout code
3948
uses: actions/checkout@v4
4049
with:
4150
submodules: false
4251
persist-credentials: false
4352

44-
- name: Install clang-format
45-
run: |
46-
sudo apt-get update
47-
sudo apt-get install -y clang-format colordiff
48-
49-
- name: Get changed files
50-
id: changed-files
51-
uses: tj-actions/changed-files@v46
52-
with:
53-
files: |
54-
cores/arduino/**/*.{c,cpp,cc,cxx,h,hpp}
55-
!cores/arduino/api/**
56-
loader/**/*.{c,cpp,cc,cxx,h,hpp}
57-
!loader/llext_exports.c
58-
libraries/**/*.{c,cpp,cc,cxx,h,hpp}
59-
!libraries/ea_malloc/**
60-
6153
- name: Run clang-format check
62-
if: steps.changed-files.outputs.any_changed == 'true'
63-
run: |
64-
clang-format --version
65-
exit_code=0
66-
67-
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
68-
file_fmt="${file}.tmp"
69-
clang-format ${file} > ${file_fmt}
70-
diff -q -u ${file} ${file_fmt} >> /dev/null 2>&1 || {
71-
echo "❌ Formatting issues found in: $file"
72-
colordiff -u ${file} ${file_fmt} || true
73-
exit_code=1
74-
}
75-
done
76-
77-
exit $exit_code
54+
uses: jidicula/[email protected]
55+
with:
56+
clang-format-version: '19'
57+
check-path: ${{ matrix.path['check'] }}
58+
exclude-regex: ${{ matrix.path['exclude'] }}

0 commit comments

Comments
 (0)