File: clang_format.yml

package info (click to toggle)
cpu-features 0.10.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 980 kB
  • sloc: ansic: 3,652; cpp: 3,280; sh: 495; makefile: 284
file content (24 lines) | stat: -rw-r--r-- 924 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
name: clang-format Check

on: [push, pull_request]

jobs:
  # Building using the github runner environement directly.
  clang-format:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4
    - name: Fetch origin/main
      run: git fetch origin main
    - name: List of changed file(s)
      run: git diff --name-only FETCH_HEAD

    - name: Build clang-format docker
      run: cd .github/workflows && docker build --tag=linter .
    - name: Check clang-format
      run: docker run --rm --init -v $(pwd):/repo linter:latest clang-format --version
    - name: clang-format help
      run: docker run --rm --init -v $(pwd):/repo linter:latest clang-format --help

    - name: Check current commit
      run: docker run --rm --init -v $(pwd):/repo -w /repo linter:latest sh -c "git diff --diff-filter=d --name-only FETCH_HEAD | grep '\.c$\|\.h$\|\.cc$' | xargs clang-format --style=file --dry-run --Werror "