| 1 |
name: Check format |
| 2 |
|
| 3 |
on: |
| 4 |
workflow_dispatch: |
| 5 |
push: |
| 6 |
branches: [ master ] |
| 7 |
paths: |
| 8 |
- '**.h' |
| 9 |
- '**.c' |
| 10 |
- 'liblouis/liblouis/liblouis.h.in' |
| 11 |
pull_request: |
| 12 |
branches: [ master ] |
| 13 |
paths: |
| 14 |
- '**.h' |
| 15 |
- '**.c' |
| 16 |
- 'liblouis/liblouis/liblouis.h.in' |
| 17 |
|
| 18 |
permissions: |
| 19 |
contents: read |
| 20 |
|
| 21 |
jobs: |
| 22 |
check-format: |
| 23 |
name: Check the code formatting |
| 24 |
|
| 25 |
runs-on: ubuntu-latest |
| 26 |
|
| 27 |
steps: |
| 28 |
- name: Harden Runner |
| 29 |
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 |
| 30 |
with: |
| 31 |
egress-policy: audit |
| 32 |
|
| 33 |
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 |
| 34 |
- name: Install dependencies |
| 35 |
run: sudo apt-get update -qq && sudo apt-get install -y clang-format-18 |
| 36 |
- name: Autogen && configure |
| 37 |
run: | |
| 38 |
./autogen.sh |
| 39 |
./configure |
| 40 |
- name: Check format |
| 41 |
run: | |
| 42 |
make format-sources |
| 43 |
git diff-index --exit-code HEAD -- . |