Use target-specific include dirs #38
This file contains hidden or 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
name: CMake Lint | |
on: | |
pull_request: | |
paths: | |
- "**/CMakeLists.txt" | |
- "**/*.cmake" | |
push: | |
paths: | |
- "**/CMakeLists.txt" | |
- "**/*.cmake" | |
workflow_dispatch: | |
jobs: | |
cmake-lint: | |
name: Check CMake formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install cmake-format | |
run: python3 -m pip install cmakelang | |
- name: Run cmake-format | |
run: | | |
files=$(git ls-files '**/CMakeLists.txt' 'cmake/*.cmake') | |
if ! cmake-format --check $files; then | |
echo "Formatting errors detected. Showing diff..." | |
for f in $files; do | |
cmake-format "$f" | diff -u "$f" - | |
done | |
exit 1 | |
fi |