mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Annotate failures for Github Actions so they're easier to spot.
This commit is contained in:
@@ -45,11 +45,21 @@ struct CI: ParsableCommand {
|
||||
try await run(.name("swiftformat"), ["--lint", "."])
|
||||
} catch {
|
||||
logger.error("\n❌ SwiftFormat failed.\n")
|
||||
annotateError(title: "SwiftFormat lint failed", "Run `swiftformat .` from the project root and commit the changes.")
|
||||
throw error
|
||||
}
|
||||
logger.info("\n✅ SwiftFormat passed.\n")
|
||||
}
|
||||
|
||||
// MARK: - GitHub Actions
|
||||
|
||||
/// Logs an error annotation, surfacing the failure on the workflow run's summary page.
|
||||
///
|
||||
/// This is printed directly as the workflow command must be at the very start of the line.
|
||||
static func annotateError(title: String, _ message: String) {
|
||||
print("::error title=\(title)::\(message)")
|
||||
}
|
||||
|
||||
// MARK: - Test Results
|
||||
|
||||
/// Collects coverage from an xcresult bundle using xcresultparser (cobertura format).
|
||||
|
||||
Reference in New Issue
Block a user