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 42bcf51
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 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
27 changes: 23 additions & 4 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,35 @@ name: Linting
on:
push:
branches:
- develop
- main
- 'release/rocm-rel*'
- 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-formatting:
name: CMake File Formatting
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 gersemi
- name: Run gersemi
run: |
gersemi --check .
if [ $? -ne 0 ]; then
echo "CMake files are not formatted correctly. Please run gersemi ..."
echo "For example: \`gersemi -i .\`"
exit 1
fi

0 comments on commit 42bcf51

Please sign in to comment.