-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
action.yml
155 lines (146 loc) · 5.3 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
name: go-test-coverage
author: vladopajic
description: go-test-coverage is a tool designed to report issues when test coverage falls below a specified threshold.
inputs:
# Config
config:
description: Path to the configuration file (.testcoverage.yml), which defines test coverage settings and thresholds.
required: false
default: ""
type: string
# Individual properties
profile:
description: Path to the coverage profile file. Overrides value from configuration.
required: false
default: ""
type: string
local-prefix:
description: When specified reported file paths will not contain local prefix in the output. Overrides value from configuration.
required: false
default: ""
type: string
threshold-file:
description: Minimum coverage percentage required for individual files. Overrides value from configuration.
required: false
default: -1
type: number
threshold-package:
description: Minimum coverage percentage required for each package. Overrides value from configuration.
required: false
default: -1
type: number
threshold-total:
description: Minimum overall project coverage percentage required. Overrides value from configuration.
required: false
default: -1
type: number
breakdown-file-name:
description: File name of go-test-coverage breakdown file, which can be used to analyze coverage difference. Overrides value from configuration.
required: false
default: ""
type: string
diff-base-breakdown-file-name:
description: File name of go-test-coverage breakdown file used to calculate coverage difference from current (head).
required: false
default: ""
type: string
# Badge (as file)
badge-file-name:
description: If specified, a coverage badge will be generated and saved to the given file path.
required: false
default: ""
type: string
# Badge (on CDN)
cdn-secret:
description: API secret key for CDN. If specified, the badge will be uploaded to the CDN.
required: false
default: ""
type: string
cdn-key:
description: API key for CDN access.
required: false
default: ""
type: string
cdn-region:
description: Specifies the CDN region for the badge upload.
required: false
default: ""
type: string
cdn-endpoint:
description: URL endpoint for CDN where the badge will be uploaded.
required: false
default: ""
type: string
cdn-file-name:
description: Filename (including path) for storing the badge on the CDN.
required: false
default: ""
type: string
cdn-bucket-name:
description: Name of the CDN bucket where the badge will be saved.
required: false
default: ""
type: string
cdn-force-path-style:
description: Forces path-style URL access in the CDN.
required: false
default: false
type: boolean
# Badge (on Git)
git-token:
description: GitHub token for authorization. If provided, the badge will be uploaded to the specified GitHub repository.
required: false
default: ""
type: string
git-repository:
description: Target GitHub repository in {owner}/{repository} format where the badge will be stored.
required: false
default: ${{ github.repository }}
type: string
git-branch:
description: Repository branch where the badge file will be saved.
required: false
default: ""
type: string
git-file-name:
description: File name (including path) for storing the badge in the specified repository.
required: false
default: .badges/${{ github.ref_name }}/coverage.svg
type: string
outputs:
total-coverage:
description: Integer value in the range [0-100], representing the overall project test coverage percentage.
badge-color:
description: Color hex code for the badge (e.g., `#44cc11`), representing the coverage status.
report:
description: JSON-encoded string containing the detailed test coverage report.
badge-text:
description: Deprecated! Text label for the badge.
runs:
using: docker
image: docker://ghcr.io/vladopajic/go-test-coverage:v2.11.1
args:
- --config=${{ inputs.config || '''''' }}
- --profile=${{ inputs.profile || '''''' }}
- --github-action-output=true
- --local-prefix=${{ inputs.local-prefix || '''''' }}
- --threshold-file=${{ inputs.threshold-file }}
- --threshold-package=${{ inputs.threshold-package }}
- --threshold-total=${{ inputs.threshold-total }}
- --breakdown-file-name=${{ inputs.breakdown-file-name || '''''' }}
- --diff-base-breakdown-file-name=${{ inputs.diff-base-breakdown-file-name || '''''' }}
- --badge-file-name=${{ inputs.badge-file-name || '''''' }}
- --cdn-key=${{ inputs.cdn-key || '''''' }}
- --cdn-secret=${{ inputs.cdn-secret || '''''' }}
- --cdn-region=${{ inputs.cdn-region || '''''' }}
- --cdn-endpoint=${{ inputs.cdn-endpoint || '''''' }}
- --cdn-file-name=${{ inputs.cdn-file-name || '''''' }}
- --cdn-bucket-name=${{ inputs.cdn-bucket-name || '''''' }}
- --cdn-force-path-style=${{ inputs.cdn-force-path-style }}
- --git-token=${{ inputs.git-token || '''''' }}
- --git-branch=${{ inputs.git-branch || '''''' }}
- --git-repository=${{ inputs.git-repository || ''''''}}
- --git-file-name=${{ inputs.git-file-name || '''''' }}
branding:
icon: 'code'
color: 'blue'