Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a cmake formatting tool in the CI #670

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gersemirc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (C) The DDC development team, see COPYRIGHT.md file
#
# SPDX-License-Identifier: MIT

# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/0.17.0/gersemi/configuration.schema.json

definitions: ["cmake"]
indent: 4
line_length: 100
19 changes: 19 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ jobs:
if: always()
uses: fsfe/reuse-action@v4

cmake-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install python3 virtual environments
run: |
sudo apt-get update
sudo apt-get --yes install python3-pip python3-venv
- name: Install gersemi
run: |
python3 -m venv ./gersemi
. ./gersemi/bin/activate
python3 -m pip install gersemi==0.17
- name: Run gersemi
run: |
. ./gersemi/bin/activate
gersemi --check cmake/DDCVendorConfiguration.cmake
find CMakeLists.txt tests/ examples/ benchmarks/ -name 'CMakeLists.txt' -exec gersemi --check '{}' '+'

id_repo:
runs-on: ubuntu-latest
steps:
Expand Down
Loading