-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
CodecovActionV3.kt
376 lines (365 loc) · 15.2 KB
/
CodecovActionV3.kt
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
// changes will be overwritten with the next binding code regeneration.
// See https://github.com/typesafegithub/github-workflows-kt for more info.
@file:Suppress(
"DataClassPrivateConstructor",
"UNUSED_PARAMETER",
"DEPRECATION",
)
package io.github.typesafegithub.workflows.actions.codecov
import io.github.typesafegithub.workflows.domain.actions.Action
import io.github.typesafegithub.workflows.domain.actions.RegularAction
import java.util.LinkedHashMap
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.collections.toList
import kotlin.collections.toTypedArray
/**
* Action: Codecov
*
* GitHub Action that uploads coverage reports for your repository to codecov.io
*
* [Action on GitHub](https://github.com/codecov/codecov-action)
*
* @param token Repository upload token - get it from codecov.io. Required only for private
* repositories
* @param file Path to coverage file to upload
* @param files Comma-separated list of files to upload
* @param directory Directory to search for coverage reports.
* @param flags Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
* @param fullReport Specify the path of a full Codecov report to re-upload
* @param commitParent The commit SHA of the parent for which you are uploading coverage. If not
* present, the parent will be determined using the API of your repository provider. When using the
* repository providers API, the parent is determined via finding the closest ancestor to the commit.
* @param dryRun Don't upload files to Codecov
* @param envVars Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)
* @param failCiIfError Specify whether or not CI build should fail if Codecov runs into an error
* during upload
* @param functionalities Comma-separated list, see the README for options and their usage. Options
* include `network`, `fixes`, `search`.
* @param gcov Run with gcov support
* @param gcovArgs Extra arguments to pass to gcov
* @param gcovExecutable gcov executable to run. Defaults to gcov
* @param gcovIgnore Paths to ignore during gcov gathering
* @param gcovInclude Paths to include during gcov gathering
* @param moveCoverageToTrash Move discovered coverage reports to the trash
* @param name User defined upload name. Visible in Codecov UI
* @param networkFilter Specify a filter on the files listed in the network section of the Codecov
* report. Useful for upload-specific path fixing
* @param networkPrefix Specify a prefix on files listed in the network section of the Codecov
* report. Useful to help resolve path fixing
* @param os Override the assumed OS. Options are aarch64 | alpine | linux | macos | windows.
* @param overrideBranch Specify the branch name
* @param overrideBuild Specify the build number
* @param overrideCommit Specify the commit SHA
* @param overridePr Specify the pull request number
* @param overrideTag Specify the git tag
* @param rootDir Used when not in git/hg project to identify project root directory
* @param slug Specify the slug manually (Enterprise use)
* @param swift Run with swift coverage support
* @param swiftProject Specify the swift project to speed up coverage conversion
* @param upstreamProxy The upstream http proxy server to connect through
* @param url Change the upload host (Enterprise use)
* @param verbose Specify whether the Codecov output should be verbose
* @param version Specify which version of the Codecov Uploader should be used. Defaults to `latest`
* @param workingDirectory Directory in which to execute codecov.sh
* @param xcode Run with xcode support
* @param xcodeArchivePath Specify the xcode archive path. Likely specified as the -resultBundlePath
* and should end in .xcresult
* @param xtraArgs Add additional uploader args that may be missing in the Action
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
* the binding
* @param _customVersion Allows overriding action's version, for example to use a specific minor
* version, or a newer version that the binding doesn't yet know about
*/
@Deprecated(
message = "This action has a newer major version: CodecovActionV4",
replaceWith = ReplaceWith("CodecovActionV4"),
)
public data class CodecovActionV3 private constructor(
/**
* Repository upload token - get it from codecov.io. Required only for private repositories
*/
public val token: String? = null,
/**
* Path to coverage file to upload
*/
public val `file`: String? = null,
/**
* Comma-separated list of files to upload
*/
public val files: List<String>? = null,
/**
* Directory to search for coverage reports.
*/
public val directory: String? = null,
/**
* Flag upload to group coverage metrics (e.g. unittests | integration | ui,chrome)
*/
public val flags: List<String>? = null,
/**
* Specify the path of a full Codecov report to re-upload
*/
public val fullReport: String? = null,
/**
* The commit SHA of the parent for which you are uploading coverage. If not present, the parent
* will be determined using the API of your repository provider. When using the repository
* providers API, the parent is determined via finding the closest ancestor to the commit.
*/
public val commitParent: String? = null,
/**
* Don't upload files to Codecov
*/
public val dryRun: Boolean? = null,
/**
* Environment variables to tag the upload with (e.g. PYTHON | OS,PYTHON)
*/
public val envVars: List<String>? = null,
/**
* Specify whether or not CI build should fail if Codecov runs into an error during upload
*/
public val failCiIfError: Boolean? = null,
/**
* Comma-separated list, see the README for options and their usage. Options include `network`,
* `fixes`, `search`.
*/
public val functionalities: List<String>? = null,
/**
* Run with gcov support
*/
public val gcov: Boolean? = null,
/**
* Extra arguments to pass to gcov
*/
public val gcovArgs: List<String>? = null,
/**
* gcov executable to run. Defaults to gcov
*/
public val gcovExecutable: String? = null,
/**
* Paths to ignore during gcov gathering
*/
public val gcovIgnore: List<String>? = null,
/**
* Paths to include during gcov gathering
*/
public val gcovInclude: List<String>? = null,
/**
* Move discovered coverage reports to the trash
*/
public val moveCoverageToTrash: Boolean? = null,
/**
* User defined upload name. Visible in Codecov UI
*/
public val name: String? = null,
/**
* Specify a filter on the files listed in the network section of the Codecov report. Useful for
* upload-specific path fixing
*/
public val networkFilter: String? = null,
/**
* Specify a prefix on files listed in the network section of the Codecov report. Useful to help
* resolve path fixing
*/
public val networkPrefix: String? = null,
/**
* Override the assumed OS. Options are aarch64 | alpine | linux | macos | windows.
*/
public val os: CodecovActionV3.OperatingSystem? = null,
/**
* Specify the branch name
*/
public val overrideBranch: String? = null,
/**
* Specify the build number
*/
public val overrideBuild: Int? = null,
/**
* Specify the commit SHA
*/
public val overrideCommit: String? = null,
/**
* Specify the pull request number
*/
public val overridePr: Int? = null,
/**
* Specify the git tag
*/
public val overrideTag: String? = null,
/**
* Used when not in git/hg project to identify project root directory
*/
public val rootDir: String? = null,
/**
* Specify the slug manually (Enterprise use)
*/
public val slug: String? = null,
/**
* Run with swift coverage support
*/
public val swift: Boolean? = null,
/**
* Specify the swift project to speed up coverage conversion
*/
public val swiftProject: String? = null,
/**
* The upstream http proxy server to connect through
*/
public val upstreamProxy: String? = null,
/**
* Change the upload host (Enterprise use)
*/
public val url: String? = null,
/**
* Specify whether the Codecov output should be verbose
*/
public val verbose: Boolean? = null,
/**
* Specify which version of the Codecov Uploader should be used. Defaults to `latest`
*/
public val version: String? = null,
/**
* Directory in which to execute codecov.sh
*/
public val workingDirectory: String? = null,
/**
* Run with xcode support
*/
public val xcode: Boolean? = null,
/**
* Specify the xcode archive path. Likely specified as the -resultBundlePath and should end in
* .xcresult
*/
public val xcodeArchivePath: String? = null,
/**
* Add additional uploader args that may be missing in the Action
*/
public val xtraArgs: String? = null,
/**
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
*/
public val _customInputs: Map<String, String> = mapOf(),
/**
* Allows overriding action's version, for example to use a specific minor version, or a newer
* version that the binding doesn't yet know about
*/
public val _customVersion: String? = null,
) : RegularAction<Action.Outputs>("codecov", "codecov-action", _customVersion ?: "v3") {
public constructor(
vararg pleaseUseNamedArguments: Unit,
token: String? = null,
`file`: String? = null,
files: List<String>? = null,
directory: String? = null,
flags: List<String>? = null,
fullReport: String? = null,
commitParent: String? = null,
dryRun: Boolean? = null,
envVars: List<String>? = null,
failCiIfError: Boolean? = null,
functionalities: List<String>? = null,
gcov: Boolean? = null,
gcovArgs: List<String>? = null,
gcovExecutable: String? = null,
gcovIgnore: List<String>? = null,
gcovInclude: List<String>? = null,
moveCoverageToTrash: Boolean? = null,
name: String? = null,
networkFilter: String? = null,
networkPrefix: String? = null,
os: CodecovActionV3.OperatingSystem? = null,
overrideBranch: String? = null,
overrideBuild: Int? = null,
overrideCommit: String? = null,
overridePr: Int? = null,
overrideTag: String? = null,
rootDir: String? = null,
slug: String? = null,
swift: Boolean? = null,
swiftProject: String? = null,
upstreamProxy: String? = null,
url: String? = null,
verbose: Boolean? = null,
version: String? = null,
workingDirectory: String? = null,
xcode: Boolean? = null,
xcodeArchivePath: String? = null,
xtraArgs: String? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(token=token, `file`=`file`, files=files, directory=directory, flags=flags,
fullReport=fullReport, commitParent=commitParent, dryRun=dryRun, envVars=envVars,
failCiIfError=failCiIfError, functionalities=functionalities, gcov=gcov,
gcovArgs=gcovArgs, gcovExecutable=gcovExecutable, gcovIgnore=gcovIgnore,
gcovInclude=gcovInclude, moveCoverageToTrash=moveCoverageToTrash, name=name,
networkFilter=networkFilter, networkPrefix=networkPrefix, os=os,
overrideBranch=overrideBranch, overrideBuild=overrideBuild,
overrideCommit=overrideCommit, overridePr=overridePr, overrideTag=overrideTag,
rootDir=rootDir, slug=slug, swift=swift, swiftProject=swiftProject,
upstreamProxy=upstreamProxy, url=url, verbose=verbose, version=version,
workingDirectory=workingDirectory, xcode=xcode, xcodeArchivePath=xcodeArchivePath,
xtraArgs=xtraArgs, _customInputs=_customInputs, _customVersion=_customVersion)
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
token?.let { "token" to it },
`file`?.let { "file" to it },
files?.let { "files" to it.joinToString(",") },
directory?.let { "directory" to it },
flags?.let { "flags" to it.joinToString(",") },
fullReport?.let { "full_report" to it },
commitParent?.let { "commit_parent" to it },
dryRun?.let { "dry_run" to it.toString() },
envVars?.let { "env_vars" to it.joinToString(",") },
failCiIfError?.let { "fail_ci_if_error" to it.toString() },
functionalities?.let { "functionalities" to it.joinToString(",") },
gcov?.let { "gcov" to it.toString() },
gcovArgs?.let { "gcov_args" to it.joinToString(" ") },
gcovExecutable?.let { "gcov_executable" to it },
gcovIgnore?.let { "gcov_ignore" to it.joinToString("\n") },
gcovInclude?.let { "gcov_include" to it.joinToString("\n") },
moveCoverageToTrash?.let { "move_coverage_to_trash" to it.toString() },
name?.let { "name" to it },
networkFilter?.let { "network_filter" to it },
networkPrefix?.let { "network_prefix" to it },
os?.let { "os" to it.stringValue },
overrideBranch?.let { "override_branch" to it },
overrideBuild?.let { "override_build" to it.toString() },
overrideCommit?.let { "override_commit" to it },
overridePr?.let { "override_pr" to it.toString() },
overrideTag?.let { "override_tag" to it },
rootDir?.let { "root_dir" to it },
slug?.let { "slug" to it },
swift?.let { "swift" to it.toString() },
swiftProject?.let { "swift_project" to it },
upstreamProxy?.let { "upstream_proxy" to it },
url?.let { "url" to it },
verbose?.let { "verbose" to it.toString() },
version?.let { "version" to it },
workingDirectory?.let { "working-directory" to it },
xcode?.let { "xcode" to it.toString() },
xcodeArchivePath?.let { "xcode_archive_path" to it },
xtraArgs?.let { "xtra_args" to it },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
override fun buildOutputObject(stepId: String): Action.Outputs = Outputs(stepId)
public sealed class OperatingSystem(
public val stringValue: String,
) {
public object Aarch64 : CodecovActionV3.OperatingSystem("aarch64")
public object Alpine : CodecovActionV3.OperatingSystem("alpine")
public object Linux : CodecovActionV3.OperatingSystem("linux")
public object Macos : CodecovActionV3.OperatingSystem("macos")
public object Windows : CodecovActionV3.OperatingSystem("windows")
public class Custom(
customStringValue: String,
) : CodecovActionV3.OperatingSystem(customStringValue)
}
}