Add cmake-format to CI #41
Workflow file for this run
This file contains 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: Linting | |
on: | |
push: | |
pull_request: | |
branches: | |
- develop | |
- main | |
- 'release/rocm-rel*' | |
jobs: | |
call-workflow-passing-data: | |
name: Documentation | |
uses: ROCm/rocm-docs-core/.github/workflows/linting.yml@develop | |
cmake: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y python3-pip | |
python3 -m pip install cmake-format | |
- name: Run cmake-format | |
run: | | |
set +e | |
cmake-format --check $(find . -type f | egrep 'CMakeLists.txt|\.cmake$') | |
if [ $? -ne 0 ]; then | |
echo "CMakeLists.txt is not formatted correctly. Please run cmake-format ..." | |
echo "For example: \`cmake-format -i CMakeLists.txt\`" | |
exit 1 | |
fi |