Trigger CI #310
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: Code Formatting | |
| on: | |
| push: | |
| branches: [main, development] | |
| pull_request: | |
| branches: [main, development] | |
| jobs: | |
| format: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [macos-latest] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| # Install clang-format if needed | |
| - name: Install clang-format (Linux) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: sudo apt-get update && sudo apt-get install -y clang-format | |
| - name: Install clang-format (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: brew install clang-format || true | |
| # Check formatting | |
| - name: Check C/C++ formatting | |
| run: | | |
| if ! git ls-files '*.c' '*.h' | xargs clang-format --dry-run -Werror; then | |
| echo "ERROR: Some files are not properly formatted." | |
| echo "Fix with: git ls-files '*.c' '*.h' | xargs clang-format -i" | |
| exit 1 | |
| fi | |
| echo "All files are properly formatted." |