|
22 | 22 | default: 'warning'
|
23 | 23 |
|
24 | 24 | jobs:
|
25 |
| - filter-format-check: |
26 |
| - runs-on: ubuntu-latest |
27 |
| - 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' }} |
34 |
| - steps: |
35 |
| - - name: Get changed source files |
36 |
| - id: changed-files |
37 |
| - uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5 |
38 |
| - 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/**' |
51 |
| -
|
52 |
| - format-check: |
| 25 | + verify-format: |
53 | 26 | runs-on: ubuntu-latest
|
54 |
| - 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 |
| - |
71 | 27 | steps:
|
72 | 28 | - name: Checkout code
|
73 |
| - if: needs.filter-format-check.outputs[format('{0}_any_changed', matrix.path['name'])] == 'true' |
74 | 29 | uses: actions/checkout@v4
|
75 | 30 | with:
|
76 | 31 | submodules: false
|
77 | 32 | persist-credentials: false
|
78 |
| - |
| 33 | + - name: Get changed source files that need format check |
| 34 | + id: changed-files |
| 35 | + uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5 |
| 36 | + with: |
| 37 | + files: | |
| 38 | + cores/arduino/**/*.{c,cpp,h,hpp,ino} |
| 39 | + loader/**/*.{c,cpp,h,hpp,ino} |
| 40 | + libraries/**/*.{c,cpp,h,hpp,ino} |
| 41 | + files_ignore: | |
| 42 | + cores/arduino/api/** |
| 43 | + loader/llext_exports.c |
| 44 | + libraries/examples/** |
| 45 | + libraries/extras/** |
| 46 | + libraries/ea_malloc/** |
| 47 | + write_output_files: true |
| 48 | + - name: List changed files |
| 49 | + if: steps.changed-files.outputs.any_changed == 'true' |
| 50 | + run: cat .github/outputs/all_changed_files.txt |
79 | 51 | - name: Run clang-format check
|
80 |
| - if: needs.filter-format-check.outputs[format('{0}_any_changed', matrix.path['name'])] == 'true' |
81 |
| - uses: jidicula/clang-format-action@v4.15.0 |
| 52 | + if: steps.changed-files.outputs.any_changed == 'true' |
| 53 | + uses: pillo79/clang-format-action@main |
82 | 54 | with:
|
83 | 55 | 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 |
| 56 | + check-files-from: .github/outputs/all_changed_files.txt |
0 commit comments