Skip to content

Commit 99b252b

Browse files
committed
format-check: add collect errors job
The Github UI for required checks does not integrate with the workflows described in the .github directory. Currently jobs that are never started due to conditional execution are not even reported, so the UI shows "expected" and locks up merges. Collect format errors so that the Github UI can be happy to track one job that is always executed. This job will fail if any of the format-check jobs failed or were cancelled, and will be ignored (but reported) otherwise. Signed-off-by: Luca Burelli <[email protected]>
1 parent a26551e commit 99b252b

File tree

2 files changed

+49
-17
lines changed

2 files changed

+49
-17
lines changed

.github/workflows/format_check.yml

Lines changed: 44 additions & 13 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,11 +13,6 @@ on:
1813
- synchronize
1914
branches:
2015
- 'main'
21-
paths:
22-
- '**/*.c'
23-
- '**/*.cpp'
24-
- '**/*.h'
25-
- '**/*.hpp'
2616

2717
workflow_dispatch:
2818
inputs:
@@ -32,29 +22,70 @@ on:
3222
default: 'warning'
3323

3424
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+
steps:
32+
- name: Get changed source files
33+
id: changed-files
34+
uses: tj-actions/changed-files@
35+
with:
36+
files_yaml: |
37+
core:
38+
- cores/arduino/**/*.{c,cpp,h,hpp}
39+
- '!cores/arduino/api/**'
40+
loader:
41+
- loader/**/*.{c,cpp,h,hpp}
42+
- '!loader/llext_exports.c'
43+
libraries:
44+
- libraries/**/*.{c,cpp,h,hpp}
45+
- '!libraries/examples/**'
46+
- '!libraries/extras/**'
47+
- '!libraries/ea_malloc/**'
48+
3549
format-check:
3650
runs-on: ubuntu-latest
51+
needs:
52+
- filter-format-check
3753
strategy:
3854
matrix:
3955
path:
40-
- check: 'cores/arduino/'
56+
- name: 'core'
57+
check: 'cores/arduino/'
4158
exclude: 'cores/arduino/api/'
42-
- check: 'loader/'
59+
- name: 'loader'
60+
check: 'loader/'
4361
exclude: 'loader/llext_exports\.c$'
44-
- check: 'libraries/'
62+
- name: 'libraries'
63+
check: 'libraries/'
4564
exclude: '(examples|extras|ea_malloc)'
4665
fail-fast: false
4766

4867
steps:
4968
- name: Checkout code
69+
if: needs.filter-format-check.outputs.${{ matrix.path['name'] }}_any_changed == 'true'
5070
uses: actions/checkout@v4
5171
with:
5272
submodules: false
5373
persist-credentials: false
5474

5575
- name: Run clang-format check
76+
if: needs.filter-format-check.outputs.${{ matrix.path['name'] }}_any_changed == 'true'
5677
uses: jidicula/[email protected]
5778
with:
5879
clang-format-version: '19'
5980
check-path: ${{ matrix.path['check'] }}
6081
exclude-regex: ${{ matrix.path['exclude'] }}
82+
83+
verify-format:
84+
name: Collect job errors
85+
runs-on: ubuntu-latest
86+
if: cancelled() || contains(needs.*.result, 'failure')
87+
needs:
88+
- format-check
89+
steps:
90+
- name: Notify failure
91+
run: exit 1

west.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,15 @@ manifest:
2626
name-allowlist:
2727
- cmsis
2828
- cmsis_6
29+
- fatfs
2930
- littlefs
30-
- tinycrypt
31+
- lvgl
3132
- mbedtls
32-
- segger
33-
- thrift
3433
- mcuboot
3534
- nanopb
36-
- lvgl
35+
- segger
36+
- thrift
37+
- tinycrypt
3738
path-allowlist:
3839
- modules/hal/*
3940

0 commit comments

Comments
 (0)