Structure
CoverageAction
Reads and summarizes native coverage artifacts produced by a prior test run.
struct CoverageActionOverview
ShipItSwifty does not generate coverage data itself — it wraps and normalises the artifacts that your platform toolchain already produces:
iOS:
.xcresultbundles created byxcodebuild test -enableCodeCoverage YESAndroid: JaCoCo XML reports generated by Gradle’s
jacocoTestReporttask
Usage
// iOS — infer xcresult from config
let result = try await CoverageAction().run(
with: .init(firstPartyOnly: true, format: .text),
context: context
)
print("Overall: \(result.overallLineCoverage)%")
// Android — explicit report path
let result = try await CoverageAction().run(
with: .init(reportPath: "./app/build/reports/jacoco/test/jacocoTestReport.xml"),
context: androidContext
)
for module in result.modules { print("\(module.name): \(module.lineCoverage)%") }Topics
Configuration
struct OptionsConfiguration options for the coverage action.
Results
struct ResultSummary of coverage across all selected targets/modules.
struct CoverageTargetCoverage entry for a single target (iOS) or module/package (Android).
struct CoverageFileCoverage entry for a single source file.
Initializers
Instance Methods
func run(with: CoverageAction.Options, context: ActionContext) async throws -> CoverageAction.ResultExecute the action with the given options.
Type Properties
static let description: StringLong-form description for
--helpoutput and documentation.static let name: StringHuman-readable identifier, e.g.
"build","upload".
Default Implementations
Relationships
Conforms To
ActionSwift.SendableSwift.SendableMetatype