-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (44 loc) · 1.53 KB
/
reviewdog.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
name: VaRA Feature Library Reviewdog
on:
pull_request:
branches: [ vara, vara-dev ]
jobs:
format:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
tool: [ clang-format ]
include:
- tool: clang-format
install: |
sudo apt-key adv --fetch-keys https://apt.llvm.org/llvm-snapshot.gpg.key
sudo add-apt-repository -y 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main'
sudo apt-get update
sudo apt-get -y install --no-install-recommends clang-format-14
regex: \.(h|c|hpp|cpp)$
command: clang-format-14 --style=file -i
continue-on-error: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Dependencies
shell: bash
run: ${{ matrix.install }}
- name: Fetch Base Branch
shell: bash
run: |
git fetch --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
- name: Run Tool
shell: bash
run: |
FILES=$(git diff --name-only --diff-filter=AM origin/${{ github.base_ref }} HEAD | egrep "${{ matrix.regex }}" || true)
[ -z "$FILES" ] || (${{ matrix.command }} $FILES && git diff --diff-filter=M $FILES)
- name: Add Suggestions
uses: reviewdog/action-suggester@v1
with:
tool_name: ${{ matrix.tool }}
filter_mode: diff_context
level: warning