Skip to content

Commit d2a29d8

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

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,26 @@ jobs:
5050
<table>
5151
<thead>
5252
<tr>
53-
<th></th>
5453
<th>Test</th>
54+
<th>Failure</th>
5555
</tr>
5656
</thead>
5757
<tbody>
5858
EOF
5959
6060
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>"
61+
map(.failed_tests) | flatten | map({
62+
klass,
63+
NAME,
64+
failure: .failures[0],
65+
source_url: .source_location | if .[0] | contains("/gems/") then
66+
(.[0] | capture("rails-(?<sha>.*?)/(?<path>.*)")) *
67+
{line: .[1], server: "https://github.com", repo: "rails/rails"}
68+
else
69+
{path: .[0], line: .[1], sha: $ENV.GITHUB_SHA, repo: $ENV.GITHUB_REPOSITORY, server: $ENV.GITHUB_SERVER_URL}
70+
end | "\(.server)/\(.repo)/blob/\(.sha)/\(.path)#L\(.line)"
71+
}) | unique | sort[0:100][]
72+
| "<tr><td><a href=\"\(.source_url)\">\(.klass)#\(.NAME)</a></td><td><pre>\(.failure)</pre></td></tr>"
6373
' reports/*/report.json >>$GITHUB_STEP_SUMMARY
6474
6575
cat <<EOF >>$GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)