forked from ZedThree/clang-tidy-review
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
79 lines (76 loc) · 2.46 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
name: 'clang-tidy review'
author: 'Peter Hill'
description: 'Create a pull request review based on warnings from clang-tidy'
branding:
icon: 'book-open'
color: 'red'
inputs:
repo:
default: ${{ github.repository }}
pr:
default: ${{ github.event.pull_request.number }}
token:
description: 'GitHub authentication token'
default: ${{ github.token }}
required: false
working_dir:
description: 'Working directory'
default: ${{ github.workspace }}
required: false
base_dir:
description: 'Absolute path of initial working directory to fix absolute paths in clang-tidy fixes file'
default: ${{ github.workspace }}
required: false
fixes_file:
description: 'Path to pre-generated clang-tidy fixes file'
required: true
include:
description: 'Comma-separated list of files or patterns to include'
default: "*.[ch],*.[ch]xx,*.[ch]pp,*.[ch]++,*.cc,*.hh"
required: false
exclude:
description: 'Comma-separated list of files or patterns to exclude'
default: ''
required: false
max_comments:
description: 'Maximum number of comments to post at once'
required: false
default: '25'
lgtm_comment_body:
description: 'Message to post on PR if no issues are found. An empty string will post no LGTM comment.'
required: false
default: '`clang-tidy` found no issues, all clean :+1:'
artifacts_dir:
description: 'Directory to save artifacts in'
default: ${{ github.workspace }}
required: false
outputs:
total_comments:
description: 'Total number of warnings from clang-tidy'
value: ${{ steps.run-review.outputs.total_comments }}
runs:
using: composite
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python dependencies
shell: bash
run: pip install -r ${GITHUB_ACTION_PATH}/requirements.txt
- name: Run clang-tidy review
id: run-review
shell: bash
run: >-
cd ${{ inputs.working_dir }} &&
${GITHUB_ACTION_PATH}/review.py
--repo=${{ inputs.repo }}
--pr=${{ inputs.pr }}
--token=${{ inputs.token }}
--base-dir=${{ inputs.base_dir }}
--fixes-file=${{ inputs.fixes_file }}
--include='${{ inputs.include }}'
--exclude='${{ inputs.exclude }}'
--max-comments=${{ inputs.max_comments }}
--lgtm-comment-body='${{ inputs.lgtm_comment_body }}'
--artifacts-dir=${{ inputs.artifacts_dir }}