-
Notifications
You must be signed in to change notification settings - Fork 45
/
action.yml
95 lines (95 loc) · 3.45 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
85
86
87
88
89
90
91
92
93
94
95
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:
token:
description: 'Authentication token'
default: ${{ github.token }}
required: false
build_dir:
description: 'Directory containing the compile_commands.json file'
default: '.'
required: false
base_dir:
description: 'Absolute path to initial working directory. Useful if generating `compile_commands.json` outside of the Action'
default: ${{ github.workspace }}
require: false
clang_tidy_version:
description: 'Version of clang-tidy to use; one of 14, 15, 16, 17, 18'
default: '18'
required: false
clang_tidy_checks:
description: 'List of checks'
default: '-*,performance-*,readability-*,bugprone-*,clang-analyzer-*,cppcoreguidelines-*,mpi-*,misc-*'
required: false
config_file:
description: 'Location of .clang-tidy config file. If specified, takes preference over `clang_tidy_checks`'
default: ''
required: false
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'
required: false
default: ''
apt_packages:
description: 'Comma-separated list of apt packages to install'
required: false
default: ''
cmake_command:
description: 'If set, run CMake as part of the action using this command'
required: false
default: ''
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 review says "All clean, LGTM! :+1:"'
split_workflow:
description: "Only generate but don't post the review, leaving it for the second workflow. Relevant when receiving PRs from forks that don't have the required permissions to post reviews."
required: false
default: false
annotations:
description: "Use annotations instead of comments. See README for limitations on annotations"
required: false
default: false
parallel:
description: "Number of tidy instances to be run in parallel. Zero will automatically determine the right number."
required: false
default: "0"
pr:
default: ${{ github.event.pull_request.number }}
repo:
default: ${{ github.repository }}
outputs:
total_comments:
description: 'Total number of warnings from clang-tidy'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- --clang_tidy_binary=clang-tidy-${{ inputs.clang_tidy_version }}
- --token=${{ inputs.token }}
- --repo=${{ inputs.repo }}
- --pr=${{ inputs.pr }}
- --build_dir=${{ inputs.build_dir }}
- --base_dir=${{ inputs.base_dir }}
- --clang_tidy_checks=${{ inputs.clang_tidy_checks }}
- --config_file=${{ inputs.config_file }}
- --include='${{ inputs.include }}'
- --exclude='${{ inputs.exclude }}'
- --apt-packages=${{ inputs.apt_packages }}
- --cmake-command='${{ inputs.cmake_command }}'
- --max-comments=${{ inputs.max_comments }}
- --lgtm-comment-body='${{ inputs.lgtm_comment_body }}'
- --split_workflow=${{ inputs.split_workflow }}
- --annotations=${{ inputs.annotations }}
- --parallel=${{ inputs.parallel }}