Skip to content

github: fix verify jobs to always report status #96

github: fix verify jobs to always report status

github: fix verify jobs to always report status #96

Workflow file for this run

name: 'Format Check'
on:
push:
branches:
- 'main'
pull_request:
types:
- opened
- edited
- reopened
- synchronize
branches:
- 'main'
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
jobs:
check-changes:
runs-on: ubuntu-latest
outputs:
should-check: ${{ steps.filter.outputs.src }}
steps:
# Only checkout for push events, not needed for PRs
- uses: actions/checkout@v4
if: github.event_name == 'push'
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
src:
- '**/*.c'
- '**/*.cpp'
- '**/*.h'
- '**/*.hpp'
format-check:
needs: check-changes
if: needs.check-changes.outputs.should-check == 'true'
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: Run clang-format check
uses: jidicula/[email protected]
with:
clang-format-version: '19'
check-path: ${{ matrix.path['check'] }}
exclude-regex: ${{ matrix.path['exclude'] }}
verify-format:
if: always()
needs: [check-changes, format-check]
runs-on: ubuntu-latest
steps:
- name: Report Status
run: |
if [[ "${{ needs.format-check.result }}" == "failure" ]]; then
exit 1
fi