Skip to content

Commit 198711f

Browse files
authored
Add a cmakelint GitHub action (#67)
NOTE: `cmakelint`, not `cmake-lint` !!!
1 parent 8dd2972 commit 198711f

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

.github/workflows/cmakelint.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Run cmakelint over all the repo's CMake files
2+
name: cmakelint
3+
on:
4+
pull_request:
5+
paths:
6+
- '**.cmake'
7+
- '**/CMakeLists.txt'
8+
permissions:
9+
contents: read
10+
jobs:
11+
cmake-lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 #v4.1.7
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c #v6.0.0
19+
20+
- name: Set up cmakelint
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install cmakelint
24+
25+
- name: Lint all CMake files
26+
run: |
27+
FILES=$(find . -type f \( -name "CMakeLists.txt" -o -name "*.cmake" \))
28+
if [ -z "$FILES" ]; then
29+
echo "No CMake files found!"
30+
exit 1
31+
fi
32+
echo "Linting the following files:"
33+
echo "$FILES"
34+
cmakelint $FILES
35+

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ else()
195195
message(NOTICE "find_package did NOT find hip")
196196
endif()
197197

198-
# Find the CUfile library and headers on NVIDIA
198+
# Find the cuFile library and headers on NVIDIA
199199
if(CMAKE_HIP_PLATFORM STREQUAL "nvidia")
200200
find_package(CUDAToolkit REQUIRED)
201201

@@ -210,7 +210,7 @@ if(CMAKE_HIP_PLATFORM STREQUAL "nvidia")
210210
find_library(CUFILE_LIBRARY cufile PATHS ${CUDAToolkit_LIBRARY_DIR})
211211

212212
if(NOT CUFILE_LIBRARY)
213-
message(FATAL_ERROR "CUfile library not found")
213+
message(FATAL_ERROR "cuFile library not found")
214214
endif()
215215
endif()
216216

0 commit comments

Comments
 (0)