File: check-format.yml

package info (click to toggle)
liblouis 3.37.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 86,484 kB
  • sloc: ansic: 37,425; makefile: 1,308; python: 772; lisp: 390; sh: 353; perl: 221; cpp: 21
file content (43 lines) | stat: -rw-r--r-- 1,088 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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-22.04

    steps:
    - name: Harden Runner
      uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
      with:
        egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

    - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
    - name: Install dependencies
      run: sudo apt-get update -qq && sudo apt-get install -y clang-format-14
    - name: Autogen && configure
      run: |
        ./autogen.sh
        ./configure
    - name: Check format
      run: |
        make format-sources
        git diff-index --exit-code HEAD -- .