Skip to content

Commit

Permalink
Add cmake file formatting to CI
Browse files Browse the repository at this point in the history
Using gersemi - https://github.com/BlankSpruce/gersemi

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
  • Loading branch information
dgaliffiAMD committed Jun 4, 2024
1 parent fd90d0e commit 98297ae
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .gersemirc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/master/gersemi/configuration.schema.json

color: false
definitions: []
indent: 4
line_length: 80
list_expansion: favour-inlining
quiet: false
unsafe: false
workers: 12
26 changes: 21 additions & 5 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,33 @@ name: Linting

on:
push:
branches:
- develop
- main
- 'release/rocm-rel*'
pull_request:
branches:
- develop
- main
- 'release/roc-rel*'
- '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

0 comments on commit 98297ae

Please sign in to comment.