-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
84 lines (77 loc) · 2.49 KB
/
action.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: 'action-clang-tidy'
description: 'GitHub Action for clang-tidy with reviewdog'
author: '@sksat'
inputs:
github_token:
description: 'GitHub token for reviewdog'
default: '${{ github.token }}'
workdir:
description: 'working directory'
default: '.'
tool_name:
description: 'reviewdog name'
default: 'clang-tidy'
level:
description: 'reviewdog level [info,warning,error]'
default: 'warning'
reporter:
description: |
Reporter of reviewdog command [github-pr-check,github-pr-review,github-check].
Default is github-pr-check.
github-pr-review can use Markdown and add a link to rule page in reviewdog reports.
default: 'github-pr-check'
filter_mode:
description: 'reviewdog filter_mode'
default: 'nofilter'
fail_on_error:
description: 'exit code for reviewdog on error'
default: 'true'
reviewdog_version:
description: 'reviewdog version'
default: 'latest'
reviewdog_flags:
description: 'extra reviewdog option'
default: ''
runs:
using: "composite"
steps:
- name: install reviewdog
uses: reviewdog/[email protected]
with:
reviewdog_version: ${{ inputs.reviewdog_version }}
- name: install clang-tidy
#if: runner.os == 'Linux'
shell: bash
run: sudo apt-get install -y clang-tidy-11
- name: Run clang-tidy
continue-on-error: true
shell: bash
working-directory: ${{ inputs.workdir }}
run: |
run-clang-tidy-11 \
| sed "s|$(pwd)/||g" > clang_tidy_raw.log
- name: Remove clang-tidy duplicate error
shell: bash
run: |
python ${{ github.action_path }}/remove_duplicate_error.py ${{ inputs.workdir }}/clang_tidy_raw.log "clang-tidy-11" \
| tee ${{ inputs.workdir }}/clang_tidy.log
- name: reviewdog
shell: bash
working-directory: ${{ inputs.workdir }}
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ inputs.github_token }}
run: |
reviewdog \
-name "${{ inputs.tool_name }}" \
-level "${{ inputs.level }}" \
-fail-on-error="${{ inputs.fail_on_error }}" \
-filter-mode="${{ inputs.filter_mode }}" \
-diff="git diff FETCH_HEAD" \
-reporter="${{ inputs.reporter }}" \
-efm="%-Gclang-tidy%s" \
-efm="%-GError while processing%s" \
-efm="%W%f:%l:%c: warning: %m" \
-efm="%E%f:%l:%c: error: %m" \
-efm="%C%m" \
${{ inputs.reviewdog_flags }} \
< ./clang_tidy.log