Skip to content

Commit e21bdaf

Browse files
committed
feat(ci): more complete error output
1 parent 2dbca86 commit e21bdaf

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,33 @@ jobs:
5050
<table>
5151
<thead>
5252
<tr>
53-
<th></th>
53+
<th>#</th>
5454
<th>Test</th>
55+
<th>Failure</th>
5556
</tr>
5657
</thead>
5758
<tbody>
5859
EOF
5960
6061
jq --slurp --raw-output '
61-
map(.failed_tests|map("\(.klass)#\(.NAME)")) | flatten | unique | sort[0:100] | to_entries[]
62-
| "<tr><td><strong>\(.key)</strong></td><td>\(.value)</td></tr>"
62+
map(.failed_tests) | flatten | map({
63+
klass,
64+
NAME,
65+
failure: .failures[0],
66+
source_url: (
67+
.source_location | if (.[0] | contains("/gems/")) then
68+
(.[0] | capture("rails-(?<sha>.*?)/(?<path>.*)")) *
69+
{line: .[1], server: "https://github.com", repo: "rails/rails"}
70+
else
71+
{path: .[0], line: .[1], sha: $ENV.GITHUB_SHA, repo: $ENV.GITHUB_REPOSITORY, server: $ENV.GITHUB_SERVER_URL}
72+
end | "\(.server)/\(.repo)/blob/\(.sha)/\(.path)#L\(.line)"
73+
)
74+
}) | group_by(.) | map(.[0] * { count: length }) | sort[0:100][]
75+
| "<tr>"
76+
+ "<td><strong>\(.count)</strong></td>"
77+
+ "<td><a href=\"\(.source_url)\">\(.klass)#\(.NAME)</a></td>"
78+
+ "<td><pre>\(.failure)</pre></td>"
79+
+ "</tr>"
6380
' reports/*/report.json >>$GITHUB_STEP_SUMMARY
6481
6582
cat <<EOF >>$GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)