forked from rizinorg/cutter
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.17 KB
/
linter.yml
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
44
45
46
47
48
49
50
51
52
name: "Linter"
on:
push:
branches:
- dev
- stable
pull_request:
branches:
- dev
- stable
jobs:
changes:
runs-on: ubuntu-latest
outputs:
clang-format: ${{ steps.filter.outputs.clang-format }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
clang-format:
- '**.cpp'
- '**.c'
- '**.h'
- '.github/workflows/linter.yml'
clang-format:
needs: changes
runs-on: ubuntu-20.04
if: ${{ needs.changes.outputs.clang-format == 'true' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install wget
run: sudo apt --assume-yes install wget
- name: Install automatic llvm (stable branch)
run: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
- name: Install clang-format-11
run: sudo apt --assume-yes install clang-format-11
- name: Install gitpython
run: sudo pip install gitpython
- name: Run clang-format
run: |
find ./src -regex '.*\.\(cpp\|h\|c\)' -exec clang-format -style=file --dry-run --Werror {} \;