-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Meta]: Add GitHub check cmake-format style action
- Loading branch information
Showing
5 changed files
with
46 additions
and
27 deletions.
There are no files selected for viewing
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Linting | ||
on: pull_request | ||
jobs: | ||
clang-format: | ||
name: clang-format style | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
path: | ||
- "isobus" | ||
- "socket_can" | ||
- "examples" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Run clang-format style check for C/C++/Protobuf programs. | ||
uses: jidicula/[email protected] | ||
with: | ||
clang-format-version: "13" | ||
check-path: ${{ matrix.path }} | ||
fallback-style: "Google" # optional | ||
cmake-format: | ||
name: cmake-format style | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
- name: Install lint tool | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install cmake-format pyyaml | ||
- name: Check cmake-lint | ||
run: find . -name CMakeLists.txt | xargs cmake-lint | ||
- name: Run cmake-format | ||
run: find . -name CMakeLists.txt | xargs cmake-format -i | ||
- name: Check cmake-format | ||
run: git diff --patch-with-stat --exit-code |
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
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