Skip to content

Commit 4840a0d

Browse files
authored
Merge pull request arduino#196 from pillo79/pr-fix-format-check-ui
format-check: add collect errors job
2 parents a26551e + 846dc36 commit 4840a0d

File tree

2 files changed

+22
-34
lines changed

2 files changed

+22
-34
lines changed

.github/workflows/format_check.yml

Lines changed: 22 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ on:
44
push:
55
branches:
66
- 'main'
7-
paths:
8-
- '**/*.c'
9-
- '**/*.cpp'
10-
- '**/*.h'
11-
- '**/*.hpp'
127

138
pull_request:
149
types:
@@ -18,43 +13,37 @@ on:
1813
- synchronize
1914
branches:
2015
- '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'
3316

3417
jobs:
35-
format-check:
18+
verify-format:
3619
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-
4820
steps:
4921
- name: Checkout code
5022
uses: actions/checkout@v4
5123
with:
5224
submodules: false
5325
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
5544
- name: Run clang-format check
56-
uses: jidicula/[email protected]
45+
if: steps.changed-files.outputs.any_changed == 'true'
46+
uses: pillo79/clang-format-action@05f671e71f0758aba4d3c9dbb0ee81bc5f0137c6
5747
with:
5848
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

.github/workflows/package_core.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ jobs:
184184
failOnError: false
185185

186186
verify-core:
187-
name: Collect job errors
188187
runs-on: ubuntu-latest
189188
if: cancelled() || contains(needs.*.result, 'failure')
190189
needs:

0 commit comments

Comments
 (0)