|
4 | 4 | push:
|
5 | 5 | branches:
|
6 | 6 | - 'main'
|
7 |
| - paths: |
8 |
| - - '**/*.c' |
9 |
| - - '**/*.cpp' |
10 |
| - - '**/*.h' |
11 |
| - - '**/*.hpp' |
12 | 7 |
|
13 | 8 | pull_request:
|
14 | 9 | types:
|
|
18 | 13 | - synchronize
|
19 | 14 | branches:
|
20 | 15 | - 'main'
|
21 |
| - paths: |
22 |
| - - '**/*.c' |
23 |
| - - '**/*.cpp' |
24 |
| - - '**/*.h' |
25 |
| - - '**/*.hpp' |
26 |
| - |
27 |
| - workflow_dispatch: |
28 |
| - inputs: |
29 |
| - logLevel: |
30 |
| - description: 'Log level' |
31 |
| - required: true |
32 |
| - default: 'warning' |
33 | 16 |
|
34 | 17 | jobs:
|
35 |
| - format-check: |
| 18 | + verify-format: |
36 | 19 | 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: '(examples|extras|ea_malloc)' |
46 |
| - fail-fast: false |
47 |
| - |
48 | 20 | steps:
|
49 | 21 | - name: Checkout code
|
50 | 22 | uses: actions/checkout@v4
|
51 | 23 | with:
|
52 | 24 | submodules: false
|
53 | 25 | persist-credentials: false
|
54 |
| - |
| 26 | + - name: Get changed source files that need format check |
| 27 | + id: changed-files |
| 28 | + uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5 |
| 29 | + with: |
| 30 | + files: | |
| 31 | + cores/arduino/**/*.{c,cpp,h,hpp,ino} |
| 32 | + loader/**/*.{c,cpp,h,hpp,ino} |
| 33 | + libraries/**/*.{c,cpp,h,hpp,ino} |
| 34 | + files_ignore: | |
| 35 | + cores/arduino/api/** |
| 36 | + loader/llext_exports.c |
| 37 | + libraries/examples/** |
| 38 | + libraries/extras/** |
| 39 | + libraries/ea_malloc/** |
| 40 | + write_output_files: true |
| 41 | + - name: List changed files |
| 42 | + if: steps.changed-files.outputs.any_changed == 'true' |
| 43 | + run: cat .github/outputs/all_changed_files.txt |
55 | 44 | - name: Run clang-format check
|
56 |
| - |
| 45 | + if: steps.changed-files.outputs.any_changed == 'true' |
| 46 | + uses: pillo79/clang-format-action@05f671e71f0758aba4d3c9dbb0ee81bc5f0137c6 |
57 | 47 | with:
|
58 | 48 | clang-format-version: '19'
|
59 |
| - check-path: ${{ matrix.path['check'] }} |
60 |
| - exclude-regex: ${{ matrix.path['exclude'] }} |
| 49 | + check-files-from: .github/outputs/all_changed_files.txt |
0 commit comments