-
Notifications
You must be signed in to change notification settings - Fork 1
Add a cmakelint GitHub action #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 16 commits
ae9fba1
dc828a3
f1305d5
37566e2
8264bff
e67b8ac
15e25b5
b236e73
919ad49
b2d6100
8a4bbd8
9d2e6da
c53cbb0
bcc5fc4
08592ff
581eb53
4c35fc8
26676bd
9c5ec8b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,35 @@ | ||||||||
| # Run cmakelint over all the repo's CMake files | ||||||||
| name: cmakelint | ||||||||
| on: | ||||||||
| pull_request: | ||||||||
| paths: | ||||||||
| - '**.cmake' | ||||||||
| - 'CMakeLists.txt' | ||||||||
| permissions: | ||||||||
| contents: read | ||||||||
| jobs: | ||||||||
| cmake-lint: | ||||||||
| runs-on: ubuntu-latest | ||||||||
| steps: | ||||||||
| - name: Checkout repository | ||||||||
| uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 #v4.1.7 | ||||||||
|
|
||||||||
| - name: Set up Python | ||||||||
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v6.0.0 | ||||||||
|
|
||||||||
| - name: Set up cmakelint | ||||||||
| run: | | ||||||||
| python -m pip install --upgrade pip | ||||||||
| python -m pip install cmakelint | ||||||||
|
|
||||||||
| - name: Lint all CMake files | ||||||||
| run: | | ||||||||
| FILES=$(find . -type f \( -name "CMakeLists.txt" -o -name "*.cmake" \)) | ||||||||
| if [ -z "$FILES" ]; then | ||||||||
| echo "No CMake files found!" | ||||||||
| exit 1 | ||||||||
| fi | ||||||||
| echo "Linting the following files:" | ||||||||
| echo "$FILES" | ||||||||
| cmakelint $FILES | ||||||||
|
||||||||
| cmakelint $FILES | |
| # Use find -print0 and xargs -0 to handle file paths with spaces | |
| find . -type f \( -name "CMakeLists.txt" -o -name "*.cmake" \) -print0 | xargs -0 cmakelint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
Uh oh!
There was an error while loading. Please reload this page.