Skip to content

Commit a495b8c

Browse files
committed
feat(ci): more complete error output
1 parent c001c33 commit a495b8c

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,31 @@ jobs:
5050
<table>
5151
<thead>
5252
<tr>
53-
<th></th>
53+
<th>Occurences</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: .source_location | if .[0] | contains("/gems/") then
67+
(.[0] | capture("rails-(?<sha>.*?)/(?<path>.*)")) *
68+
{line: .[1], server: "https://github.com", repo: "rails/rails"}
69+
else
70+
{path: .[0], line: .[1], sha: $ENV.GITHUB_SHA, repo: $ENV.GITHUB_REPOSITORY, server: $ENV.GITHUB_SERVER_URL}
71+
end | "\(.server)/\(.repo)/blob/\(.sha)/\(.path)#L\(.line)"
72+
}) | group_by(.) | map(.[0] * { count: length }) | sort[0:100][]
73+
| "<tr>"
74+
+ "<td><strong>\(.count)</strong></td>"
75+
+ "<td><a href=\"\(.source_url)\">\(.klass)#\(.NAME)</a></td>"
76+
+ "<td><pre>\(.failure)</pre></td>"
77+
+ "</tr>"
6378
' reports/*/report.json >>$GITHUB_STEP_SUMMARY
6479
6580
cat <<EOF >>$GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)