| 1 |
name: "Coding style" |
| 2 |
|
| 3 |
on: [ push, pull_request ] |
| 4 |
|
| 5 |
permissions: |
| 6 |
contents: read |
| 7 |
|
| 8 |
|
| 9 |
env: |
| 10 |
PIP_PACKAGES: clang-format |
| 11 |
|
| 12 |
jobs: |
| 13 |
clang-format: |
| 14 |
runs-on: ubuntu-24.04 |
| 15 |
steps: |
| 16 |
- uses: actions/checkout@v4 |
| 17 |
- uses: actions/setup-python@v5 |
| 18 |
with: |
| 19 |
python-version: '3.12' |
| 20 |
- uses: ./.github/actions/pkginstall |
| 21 |
with: |
| 22 |
pip: $PIP_PACKAGES |
| 23 |
- run: clang-format -i -- **/*.c **/*.h |
| 24 |
- run: git diff --exit-code |
| 25 |
- if: failure() |
| 26 |
run: echo "Please run clang-format (or via pre-commit) against the modified sources" |