Skip to content

Commit

Permalink
Render badges in GH using shields.io
Browse files Browse the repository at this point in the history
Far better than just emojis
  • Loading branch information
kzu committed Jul 4, 2024
1 parent cf1386d commit 7290458
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/dotnet-trx/TrxCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,19 @@ static void GitHubReport(Summary summary, StringBuilder details)
var sb = new StringBuilder()
.AppendLine(
$"""
:point_right: Run {summary.Total} tests in ~ {summary.Duration.Humanize()}
:point_right: Run {summary.Total} tests in ~ {summary.Duration.Humanize()}:

""");

if (summary.Passed > 0)
sb.AppendLine($"     :white_check_mark: {summary.Passed} passed");
sb.Append($"![{summary.Passed} passed](https://img.shields.io/badge/passed-{summary.Passed}-brightgreen) ");
if (summary.Failed > 0)
sb.AppendLine($"     :x: {summary.Failed} failed");
sb.Append($"![{summary.Failed} failed](https://img.shields.io/badge/failed-{summary.Failed}-red) ");
if (summary.Skipped > 0)
sb.AppendLine($"     :grey_question: {summary.Skipped} skipped");
sb.Append($"![{summary.Skipped} skipped](https://img.shields.io/badge/skipped-{summary.Skipped}-silver) ");

sb.AppendLine();

if (summary.Total > 0)
{
sb.Append(details);
Expand Down

0 comments on commit 7290458

Please sign in to comment.