Skip to content

Commit

Permalink
Raise checkout and clang-format-action version. Add execute conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
GOB52 committed Aug 22, 2024
1 parent 4ffc376 commit 24f6bd6
Showing 1 changed file with 40 additions and 12 deletions.
52 changes: 40 additions & 12 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
name: clang-format Check
on: [push, pull_request]

env:
INCLUDE_REGEX: ^.*\.((((c|C)(c|pp|xx|\+\+)?$)|((h|H)h?(pp|xx|\+\+)?$))|(inl|ino|pde|proto|cu))$

on:
push:
paths:
- '**.ino'
- '**.cpp'
- '**.hpp'
- '**.h'
- '**.c'
- '**.inl'
- '**clang-format-check.yml'
pull_request:
- '**.ino'
- '**.cpp'
- '**.hpp'
- '**.h'
- '**.c'
- '**.inl'
- '**clang-format-check.yml'

jobs:
formatting-check:
name: Formatting Check
Expand All @@ -9,15 +31,21 @@ jobs:
path:
- check: './' # path to include
exclude: '' # path to exclude
# - check: 'src'
# exclude: '(Fonts)' # Exclude file paths containing "Fonts"
# - check: 'examples'
# exclude: ''
#- check: 'src'
# exclude: '(Fonts)' # Exclude file paths containing "Fonts"
#- check: 'examples'
# exclude: ''

steps:
- uses: actions/[email protected]
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected]
with:
clang-format-version: '13'
check-path: ${{ matrix.path['check'] }}
exclude-regex: ${{ matrix.path['exclude'] }}
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/[email protected] # Using include-regex 10.x or later
with:
clang-format-version: '13'
check-path: ${{ matrix.path['check'] }}
exclude-regex: ${{ matrix.path['exclude'] }}
include-regex: ${{ env.INCLUDE_REGEX }}

0 comments on commit 24f6bd6

Please sign in to comment.