add cmake-lint action (#646)
This commit is contained in:
parent
88a450bf1f
commit
dc5571ba98
5 changed files with 605 additions and 655 deletions
|
|
@ -3,7 +3,7 @@
|
|||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
|
||||
# the above-mentioned repo.
|
||||
|
||||
name: Clang Format Lint
|
||||
name: C++ Lint
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
|
@ -33,7 +33,7 @@ jobs:
|
|||
outputs:
|
||||
src: ${{ steps.check.outputs.src }}
|
||||
|
||||
lint:
|
||||
clang-format:
|
||||
name: Clang Format Lint
|
||||
needs: [check_src]
|
||||
if: ${{ needs.check_src.outputs.src == 'true' }}
|
||||
|
|
@ -58,3 +58,34 @@ jobs:
|
|||
with:
|
||||
name: clang-format-fixes
|
||||
path: src/
|
||||
|
||||
cmake-lint:
|
||||
name: CMake Lint
|
||||
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 dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip setuptools cmakelang
|
||||
|
||||
- name: Find cmake files
|
||||
id: cmake_files
|
||||
run: |
|
||||
cmake_files=$(find . -type f -iname "CMakeLists.txt" -o -iname "*.cmake")
|
||||
|
||||
echo "found cmake files: ${cmake_files}"
|
||||
|
||||
# do not quote to keep this as a single line
|
||||
echo cmake_files=${cmake_files} >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Test with cmake-lint
|
||||
run: |
|
||||
cmake-lint --line-width 120 --tab-size 4 ${{ steps.cmake_files.outputs.cmake_files }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue