github/codeformat: Switch to uncrustify-action.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
iabdalkader 2025-09-18 18:55:07 +02:00
parent 04145abea8
commit 75c7a4fb82

View File

@ -15,6 +15,7 @@ on:
- synchronize - synchronize
branches: branches:
- 'master' - 'master'
- 'update_code_formatter'
paths: paths:
- '**/*.{c,cc,h}' - '**/*.{c,cc,h}'
@ -28,41 +29,21 @@ jobs:
submodules: false submodules: false
persist-credentials: false persist-credentials: false
- name: '♻ Caching dependencies'
uses: actions/cache@v4.2.0
id: cache
with:
path: ~/cache/deps/bin
key: 'uncrustify'
- name: '🛠 Install dependencies'
if: steps.cache.outputs.cache-hit != 'true'
run: source tools/ci.sh && ci_install_code_format_deps
- name: '📜 Get list of changed files'
id: changed-files
uses: tj-actions/changed-files@v46
with:
files: |
**/*.{c,cc,h}
!cubeai/**
!docker/**
!docs/**
!drivers/**
drivers/sensors/*.{c,cc,h}
!lib/**
lib/imlib/*.{c,cc,h}
lib/tflm/*.{c,cc,h}
!scripts/**
!tools/**
- name: '📜 Show list of changed files'
run: |
echo "${{ toJSON(steps.changed-files.outputs) }}"
shell:
bash
- name: '🔎 Check code formatting' - name: '🔎 Check code formatting'
if: steps.changed-files.outputs.any_changed == 'true' uses: openmv/uncrustify-action@v1
run: | with:
source tools/ci.sh && ci_run_code_format_check ${{ steps.changed-files.outputs.all_changed_files }} config-path: 'tools/uncrustify.cfg'
extensions: 'c,cc,h'
exclude-patterns: |
cubeai/**
docker/**
docs/**
drivers/**
!drivers/sensors/**
lib/**
!lib/imlib/**
!lib/tflm/**
scripts/**
tools/**
uncrustify-version: '0.75.0'
fail-on-error: 'true'