add cmake-lint action (#646)

This commit is contained in:
ReenigneArcher 2022-12-29 08:24:13 -05:00 committed by GitHub
commit dc5571ba98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 605 additions and 655 deletions

View file

@ -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 }}