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
@@ -39,11 +39,13 @@ struct PreviewTests: AsyncParsableCommand {
.appending(path: "\(CI.testOutputDirectory)/\(Self.scheme).xcresult")
guard FileManager.default.fileExists(atPath: resultBundleURL.path) else {
logger.error("\n❌ Preview tests could not run. Check for compilation or configuration errors.\n")
CI.annotateError(title: "Preview tests could not run", "No result bundle was produced. Check for compilation or configuration errors.")
throw error
}
logger.info("\n📸 Snapshots recorded.\n")
} else {
logger.error("\n❌ Preview tests failed.\n")
CI.annotateError(title: "Preview tests failed", "Snapshots don't match their references. Re-record them if the change is intentional.")
testsFailed = true
}
}