Annotate failures for Github Actions so they're easier to spot.

This commit is contained in:
Stefan Ceriu
2026-08-10 19:35:36 +03:00
parent b829c6a06f
commit 42a7b6e8ee
7 changed files with 19 additions and 0 deletions
+10
View File
@@ -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).