generated from cicirello/python-github-action-template
-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
action.yml
158 lines (156 loc) · 6.1 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# jacoco-badge-generator: Coverage badges, and pull request coverage checks,
# from JaCoCo reports in GitHub Actions
#
# Copyright (c) 2020-2023 Vincent A Cicirello
# https://www.cicirello.org/
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
name: 'jacoco-badge-generator'
description: 'JaCoCo coverage badges and pull request coverage checks in GitHub Actions'
branding:
icon: 'book-open'
color: 'green'
inputs:
jacoco-csv-file:
description: 'Full path, relative to the root of the repository, to the jacoco csv file(s), including filename(s)'
required: false
default: 'target/site/jacoco/jacoco.csv'
badges-directory:
description: 'The directory for storing badges, relative to the root of the repository.'
required: false
default: '.github/badges'
coverage-badge-filename:
description: 'The filename of the coverage badge.'
required: false
default: 'jacoco.svg'
branches-badge-filename:
description: 'The filename of the branches coverage badge.'
required: false
default: 'branches.svg'
generate-coverage-badge:
description: 'Controls whether or not to generate the coverage badge.'
required: false
default: true
generate-branches-badge:
description: 'Controls whether or not to generate the branches coverage badge.'
required: false
default: false
coverage-label:
description: 'Text for the left-side of the coverage badge.'
required: false
default: coverage
branches-label:
description: 'Text for the left-side of the branches coverage badge.'
required: false
default: branches
on-missing-report:
description: 'Controls what happens if one or more jacoco.csv files do not exist.'
required: false
default: 'fail'
fail-if-coverage-less-than:
description: 'Enables failing workflow run when coverage below specified threshold.'
required: false
default: 0
fail-if-branches-less-than:
description: 'Enables failing workflow run when branches coverage below specified threshold.'
required: false
default: 0
fail-on-coverage-decrease:
description: 'Enables failing workflow if coverage is less than it was on previous run.'
required: false
default: false
fail-on-branches-decrease:
description: 'Enables failing workflow if branches coverage is less than it was on previous run.'
required: false
default: false
intervals:
description: 'List of coverage percentages as cutoffs for each color.'
required: false
default: 100 90 80 70 60 0
colors:
description: 'List of colors to use ordered by coverage interval, best coverage to worst.'
required: false
default: '#4c1 #97ca00 #a4a61d #dfb317 #fe7d37 #e05d44'
generate-coverage-endpoint:
description: 'Controls whether or not to generate the coverage JSON endpoint.'
required: false
default: false
generate-branches-endpoint:
description: 'Controls whether or not to generate the branches coverage JSON endpoint.'
required: false
default: false
coverage-endpoint-filename:
description: 'The filename of the coverage JSON endpoint.'
required: false
default: 'jacoco.json'
branches-endpoint-filename:
description: 'The filename of the branches coverage JSON endpoint.'
required: false
default: 'branches.json'
generate-summary:
description: 'Controls whether or not to generate a JSON file containing the coverage percentages as floating-point values.'
required: false
default: false
summary-filename:
description: 'The filename of the summary file.'
required: false
default: 'coverage-summary.json'
generate-workflow-summary:
description: 'Controls whether or not to append summary to the GitHub workflow summary page.'
required: false
default: true
workflow-summary-heading:
description: 'The heading for the GitHub workflow job summary'
required: false
default: JaCoCo Test Coverage Summary
outputs:
coverage:
description: 'The jacoco coverage percentage as computed from the data in the jacoco.csv file.'
branches:
description: 'The jacoco branch coverage percentage as computed from the data in the jacoco.csv file.'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.jacoco-csv-file }}
- ${{ inputs.badges-directory }}
- ${{ inputs.coverage-badge-filename }}
- ${{ inputs.branches-badge-filename }}
- ${{ inputs.generate-coverage-badge }}
- ${{ inputs.generate-branches-badge }}
- ${{ inputs.on-missing-report }}
- ${{ inputs.fail-if-coverage-less-than }}
- ${{ inputs.fail-if-branches-less-than }}
- ${{ inputs.fail-on-coverage-decrease }}
- ${{ inputs.fail-on-branches-decrease }}
- ${{ inputs.intervals }}
- ${{ inputs.colors }}
- ${{ inputs.generate-coverage-endpoint }}
- ${{ inputs.generate-branches-endpoint }}
- ${{ inputs.coverage-endpoint-filename }}
- ${{ inputs.branches-endpoint-filename }}
- ${{ inputs.generate-summary }}
- ${{ inputs.summary-filename }}
- ${{ inputs.generate-workflow-summary }}
- ${{ inputs.coverage-label }}
- ${{ inputs.branches-label }}
- ${{ inputs.workflow-summary-heading }}