ci: add check format workflow #1
This file contains hidden or 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: Check formatting | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| check-format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Qt6 | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y qt6-declarative-dev | |
| - name: Check QML formatting | |
| run: | | |
| for file in $(find . -name "*.qml" -type f); do | |
| /usr/lib/qt6/bin/qmlformat "$file" | diff -u "$file" - | |
| done | |
| - name: Check C++ formatting | |
| run: | | |
| for file in $(find . -name "*.cpp" -o -name "*.hpp" -type f); do | |
| clang-format "$file" | diff -u "$file" - | |
| done |