generated from m5stack/M5Template-C-CPP
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,51 @@ | ||
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 | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
path: | ||
#- check: './' # path to include | ||
# exclude: '' # path to exclude | ||
- check: 'src' | ||
exclude: '' | ||
- check: 'examples' | ||
exclude: '' | ||
- check: 'test' | ||
exclude: '' | ||
# 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 # When pull_request is used, include it in the checkout https://zenn.dev/hkusu/articles/c731862051438b | ||
uses: actions/[email protected] | ||
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 }} |