| name: Check format |
| |
| on: |
| workflow_dispatch: |
| push: |
| branches: [ master ] |
| paths: |
| - '**.h' |
| - '**.c' |
| - 'liblouis/liblouis/liblouis.h.in' |
| pull_request: |
| branches: [ master ] |
| paths: |
| - '**.h' |
| - '**.c' |
| - 'liblouis/liblouis/liblouis.h.in' |
| |
| permissions: # added using https://github.com/step-security/secure-workflows |
| contents: read |
| |
| jobs: |
| check-format: |
| name: Check the code formatting |
| |
| runs-on: ubuntu-latest |
| |
| steps: |
| - name: Harden Runner |
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 |
| with: |
| egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs |
| |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 |
| - name: Install dependencies |
| run: sudo apt-get update -qq && sudo apt-get install -y clang-format-18 |
| - name: Autogen && configure |
| run: | |
| ./autogen.sh |
| ./configure |
| - name: Check format |
| run: | |
| make format-sources |
| git diff-index --exit-code HEAD -- . |