test-reporter icon indicating copy to clipboard operation
test-reporter copied to clipboard

Consider supporting markdown output using the new $GITHUB_STEP_SUMMARY variable

Open baronfel opened this issue 2 years ago • 8 comments

Hello!

In lieu of the two-step process required now, I would love to see an option for raw markdown output using the newly-announced job summaries support from GitHub! I think that would be an easy way to get started and accomplish a lot of the use cases for this tool.

In any case, thank you for your work!

baronfel avatar May 09 '22 19:05 baronfel

I think it might resolve https://github.com/dorny/test-reporter/issues/67

STRRL avatar May 12 '22 03:05 STRRL

This is confirmed to work better. I did it for another action to produce android lint results. It has the nice effect of not caring if the run is manually kicked off or not, and will always show up.

However, I found the helper methods they include in core.summary to be more annoying than anything. I ended up just feeding the produced markdown into core.summary.addRaw(), and it works well.

Here is an example (don't mind the failing job here): https://github.com/HubbellCorp/SweetBlue/actions/runs/2341111644

However, one caveat is that I haven't got links to work yet. You can construct the baseUrl like this:

function getBaseUrl(): string {
  const runId = github.context.runId
  const repo = github.context.repo
  return `https://github.com/${repo.owner}/${repo.repo}/actions/runs/${runId}`
}

This may be wrong though, because while the links look right, they are not actually jumping to the anchors (it could also be a bug in my markdown generation code though).

ryanhubbell avatar May 18 '22 14:05 ryanhubbell

@ryanhubbell the link IDs are prefixed with user-content-, so the url for MissingPermission should be https://github.com/HubbellCorp/SweetBlue/actions/runs/2341111644#user-content-c0-0 etc.

This might be the source of the issue https://github.com/iDevicesInc/action-android-lint/blob/48a041c67386da99819fb2113ba4e3f2f2ecd71d/src/utils/slugger.ts#L14

xt0rted avatar May 18 '22 14:05 xt0rted

That was copied from this very repo. If you look in the src here, it's the same. I should say, the links worked fine when using the check run approach that is currently used by this repo.

ryanhubbell avatar May 18 '22 14:05 ryanhubbell

This looks like a bug on the summary page. I opened a discussion about it.

xt0rted avatar May 18 '22 15:05 xt0rted

Just checking if there was any movement on this. Would love this to be implemented since we run scheduled jobs and are missing the output currently. cc: @dorny

chapmanc avatar Jul 13 '22 22:07 chapmanc

Sorry guys, I was not maintaining the project for several months. Just getting back to it... I will definitely look into job summaries. The feature was not available back when I worked on this action.

dorny avatar Aug 18 '22 21:08 dorny

Hello, we run scheduled E2E tests and this would be a massively useful feature for us since we're not looking for PR checks 🤞 I can help test this if needed.

jussikuosa avatar Mar 21 '24 12:03 jussikuosa