Skip to content

Commit 8bc2fbc

Browse files
committed
new setup
:1
1 parent 5410550 commit 8bc2fbc

File tree

1 file changed

+22
-51
lines changed

1 file changed

+22
-51
lines changed

.github/workflows/format_check.yml

Lines changed: 22 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -22,73 +22,44 @@ on:
2222
default: 'warning'
2323

2424
jobs:
25-
filter-format-check:
25+
filter-format:
2626
runs-on: ubuntu-latest
2727
outputs:
28-
core_any_changed: ${{ steps.changed-files.outputs.core_any_changed }}
29-
loader_any_changed: ${{ steps.changed-files.outputs.loader_any_changed }}
30-
libraries_any_changed: ${{ steps.changed-files.outputs.libraries_any_changed }}
31-
any_changed: ${{ steps.changed-files.outputs.core_any_changed == 'true' ||
32-
steps.changed-files.outputs.loader_any_changed == 'true' ||
33-
steps.changed-files.outputs.libraries_any_changed == 'true' }}
28+
any_changed: ${{ steps.changed-files.outputs.any_changed }}
3429
steps:
35-
- name: Get changed source files
30+
- name: Get changed source files that need format check
3631
id: changed-files
3732
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
3833
with:
39-
files_yaml: |
40-
core:
41-
- cores/arduino/**/*.{c,cpp,h,hpp}
42-
- '!cores/arduino/api/**'
43-
loader:
44-
- loader/**/*.{c,cpp,h,hpp}
45-
- '!loader/llext_exports.c'
46-
libraries:
47-
- libraries/**/*.{c,cpp,h,hpp}
48-
- '!libraries/examples/**'
49-
- '!libraries/extras/**'
50-
- '!libraries/ea_malloc/**'
34+
files: |
35+
cores/arduino/**/*.{c,cpp,h,hpp,ino}
36+
loader/**/*.{c,cpp,h,hpp,ino}
37+
libraries/**/*.{c,cpp,h,hpp,ino}
38+
files_ignore: |
39+
cores/arduino/api/**
40+
loader/llext_exports.c
41+
libraries/examples/**
42+
libraries/extras/**
43+
libraries/ea_malloc/**
44+
write_output_files: true
45+
- name: List of changed files
46+
if: steps.changed-files.outputs.any_changed == 'true'
47+
run: cat .github/outputs/changed_files.txt
5148

52-
format-check:
49+
verify-format:
5350
runs-on: ubuntu-latest
5451
needs:
55-
- filter-format-check
56-
if: needs.filter-format-check.outputs.any_changed
57-
strategy:
58-
matrix:
59-
path:
60-
- name: 'core'
61-
check: 'cores/arduino/'
62-
exclude: 'cores/arduino/api/'
63-
- name: 'loader'
64-
check: 'loader/'
65-
exclude: 'loader/llext_exports\.c$'
66-
- name: 'libraries'
67-
check: 'libraries/'
68-
exclude: '(examples|extras|ea_malloc)'
69-
fail-fast: false
70-
52+
- filter-format
53+
if: needs.filter-format.outputs.any_changed
7154
steps:
7255
- name: Checkout code
73-
if: needs.filter-format-check.outputs[format('{0}_any_changed', matrix.path['name'])] == 'true'
7456
uses: actions/checkout@v4
7557
with:
7658
submodules: false
7759
persist-credentials: false
7860

7961
- name: Run clang-format check
80-
if: needs.filter-format-check.outputs[format('{0}_any_changed', matrix.path['name'])] == 'true'
81-
uses: jidicula/[email protected]
62+
uses: pillo79/clang-format-action@main
8263
with:
8364
clang-format-version: '19'
84-
check-path: ${{ matrix.path['check'] }}
85-
exclude-regex: ${{ matrix.path['exclude'] }}
86-
87-
verify-format:
88-
runs-on: ubuntu-latest
89-
if: cancelled() || contains(needs.*.result, 'failure')
90-
needs:
91-
- format-check
92-
steps:
93-
- name: Notify failure
94-
run: exit 1
65+
check-files-from: .github/outputs/changed_files.txt

0 commit comments

Comments
 (0)