File: clang-format.yml

package info (click to toggle)
obs-command-source 0.5.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 284 kB
  • sloc: ansic: 400; python: 80; sh: 75; makefile: 21; cpp: 16
file content (31 lines) | stat: -rw-r--r-- 654 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
name: Clang Format Check

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:
  clang:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4

    - name: Clang
      run: |
        sudo apt-get install -y clang-format-12
        clang-format -i -fallback-style=none $(git ls-files | grep '\.\(c\|h\)$')

    - name: Check
      # Build your program with the given configuration
      run: |
        dirty=$(git ls-files --modified)
        set +x
        if [[ $dirty ]]; then
          git diff
          echo "Error: File(s) are not properly formatted."
          echo "$dirty"
          exit 1
        fi