xcresulttool icon indicating copy to clipboard operation
xcresulttool copied to clipboard

Add job summary that can be used when running action as a workflow dispatch

Open JohNan opened this issue 1 year ago • 3 comments

When using this action in a workflow dispatch, such as a cron job, it can't create a "check". So to be bale to get a test summary I have added the test report to be output as job summary instead. This behaviour can be toggled using two new options.

  create-check:
    description: 'Whether to create a check'
    required: false
    default: 'true'
  create-job-summary:
    description: 'Whether to create a job summary. Should be used if the actions is not triggered via pull request'
    required: false
    default: 'false'

I also added output form the job with som stats on number of tests, failed and passed.

outputs:
  failed_tests:
    description: 'Number of failed tests'
  passed_tests:
    description: 'Number of passed tests'
  skipped_tests:
    description: 'Number of skipped tests'
  total_tests:
    description: 'Number of total tests'

JohNan avatar Aug 03 '22 13:08 JohNan

@kishikawakatsumi Any feedback on this PR is appreciated!

JohNan avatar Aug 08 '22 09:08 JohNan

@JohNan Thanks, the idea of outputting the Job Summary seems very good. I don't have time to check the behavior for a while, but will do so as soon as possible.

kishikawakatsumi avatar Aug 14 '22 10:08 kishikawakatsumi

Thank you @kishikawakatsumi I'm not sure why the tests are failing in your repo, but they are passing in my repo: https://github.com/JohNan/xcresulttool/pull/1

Could it be some kind of permission problem since it's a pull request originating from a different repo?

JohNan avatar Aug 16 '22 05:08 JohNan

Had any time looking at the PR? :)

JohNan avatar Sep 08 '22 11:09 JohNan

I'm looking into it now. Merging soon. Sorry for the late.

kishikawakatsumi avatar Sep 25 '22 19:09 kishikawakatsumi

Supersedes https://github.com/kishikawakatsumi/xcresulttool/pull/454

kishikawakatsumi avatar Sep 26 '22 17:09 kishikawakatsumi

Released in v1.6.0

kishikawakatsumi avatar Sep 26 '22 19:09 kishikawakatsumi

Thanks! You took a different approach but Im gonna try it out. I do miss the stats output though. But maybe that can be added separately? It is great when you have consecutive action that for example posts the result to Slack or something similiar.

JohNan avatar Sep 26 '22 21:09 JohNan

I see. It seems like a good idea to have a mechanism to output information that can be used by subsequent actions.

kishikawakatsumi avatar Sep 27 '22 05:09 kishikawakatsumi