-
-
Notifications
You must be signed in to change notification settings - Fork 28
format-check: add collect errors job #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,6 @@ on: | |
push: | ||
branches: | ||
- 'main' | ||
paths: | ||
- '**/*.c' | ||
- '**/*.cpp' | ||
- '**/*.h' | ||
- '**/*.hpp' | ||
|
||
pull_request: | ||
types: | ||
|
@@ -18,43 +13,37 @@ on: | |
- synchronize | ||
branches: | ||
- 'main' | ||
paths: | ||
- '**/*.c' | ||
- '**/*.cpp' | ||
- '**/*.h' | ||
- '**/*.hpp' | ||
|
||
workflow_dispatch: | ||
inputs: | ||
logLevel: | ||
description: 'Log level' | ||
required: true | ||
default: 'warning' | ||
|
||
jobs: | ||
format-check: | ||
verify-format: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
path: | ||
- check: 'cores/arduino/' | ||
exclude: 'cores/arduino/api/' | ||
- check: 'loader/' | ||
exclude: 'loader/llext_exports\.c$' | ||
- check: 'libraries/' | ||
exclude: '(examples|extras|ea_malloc)' | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: false | ||
persist-credentials: false | ||
|
||
- name: Get changed source files that need format check | ||
id: changed-files | ||
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5 | ||
with: | ||
files: | | ||
cores/arduino/**/*.{c,cpp,h,hpp,ino} | ||
loader/**/*.{c,cpp,h,hpp,ino} | ||
libraries/**/*.{c,cpp,h,hpp,ino} | ||
files_ignore: | | ||
cores/arduino/api/** | ||
loader/llext_exports.c | ||
libraries/examples/** | ||
libraries/extras/** | ||
libraries/ea_malloc/** | ||
write_output_files: true | ||
- name: List changed files | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
run: cat .github/outputs/all_changed_files.txt | ||
- name: Run clang-format check | ||
uses: jidicula/[email protected] | ||
if: steps.changed-files.outputs.any_changed == 'true' | ||
uses: pillo79/clang-format-action@05f671e71f0758aba4d3c9dbb0ee81bc5f0137c6 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose this is now needed for the action to work with these changes? Kind of an issue if your changes don't make it upstream. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it is required for the |
||
with: | ||
clang-format-version: '19' | ||
check-path: ${{ matrix.path['check'] }} | ||
exclude-regex: ${{ matrix.path['exclude'] }} | ||
check-files-from: .github/outputs/all_changed_files.txt |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -184,7 +184,6 @@ jobs: | |
failOnError: false | ||
|
||
verify-core: | ||
name: Collect job errors | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just an FYI this works too: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it's the same. I hate that GH matches the actual string generated by the job and not some unmistakable ID. At least in the UI it |
||
runs-on: ubuntu-latest | ||
if: cancelled() || contains(needs.*.result, 'failure') | ||
needs: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is okay, but is running the formatter on all PRs unconditionally that bad? Most of the PRs will likely contain code changes anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept the original idea of limiting the execution to PRs that needed it. Not a problem right now, but PRs being blocked due to compliance on unrelated files is so much of an issue in Zephyr proper that they don't enable this kind of filters 🙂