# Run cmakelint over the CMake files name: "hipFile cmakelint" on: push: branches: [develop] paths: - 'projects/hipfile/**.cmake' - 'projects/hipfile/**/CMakeLists.txt' - 'projects/hipfile/.cmakelintrc' - '.github/workflows/hipfile-cmakelint.yml' pull_request: paths: - 'projects/hipfile/**.cmake' - 'projects/hipfile/**/CMakeLists.txt' - 'projects/hipfile/.cmakelintrc' - '.github/workflows/hipfile-cmakelint.yml' concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: hipfile-cmakelint: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 with: sparse-checkout: | projects/hipfile .github/workflows - name: Set up Python uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: "3.12" - name: Set up cmakelint run: | python -m pip install --upgrade pip python -m pip install cmakelint - name: Lint all CMake files run: | cd projects/hipfile 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