Scroll to navigation

TAP::Formatter::GitHubActions(3) User Contributed Perl Documentation TAP::Formatter::GitHubActions(3)

NAME

TAP::Formatter::GitHubActions - TAP Formatter for GitHub Actions

SYNOPSIS

On the command line, with prove:

  $ prove --merge --formatter TAP::Formatter::GitHubActions ...

You can also use a ".proverc" file with

  # .proverc contents
  --lib
  --merge
  --formatter TAP::Formatter::GitHubActions

And then invoke prove without flags:

  $ prove

IMPORTANT NOTE

This formatter needs the "--merge" flag, else it won't be able to process the comments to produce GitHub-Actions-compatible output.

DESCRIPTION

"TAP::Formatter::GitHubActions" provides GitHub-Actions-compatible output for prove.

It parses TAP output and tries it's best to guess where errors are located. For more accurate results, use in cojunction with Test2::Formatter::YAMLEnhancedTAP.

Test2::Formatter::YAMLEnhancedTAP enriches the TAP output generated by Test2 and friends (Test::More, Test::Most) with an additional context in YAML format (compliant with TAP version 13) that includes the precise location of the failure.

LIMITATIONS

As of writting (3.12.2023), there is a max of 10 annotations per step, 50 per workflow.

That means: If your test result has more than 10 failures reported, you'll only see the first 10.

To overcome this, when running under GitHub Actions (detected via `GITHUB_ACTIONS` env var), the formatter writes into the workflow summary and then writes one notice on the very top of the failing file with a link to the summary.

It's not perfect, but gets the work done.

See the following links for more info:

- GitHub Community Discussion#26680: Annotation limitation <https://github.com/orgs/community/discussions/26680#discussioncomment-3252835>

- GitHub Community Discussion#68471: Extremely low annotation limit <https://github.com/orgs/community/discussions/26680#discussioncomment-3252835>

SEE ALSO

- TAP::Formatter::JUnit: JUnit XML output for your Tests!

- Test2::Formatter::YAMLEnhancedTAP: Enhanced TAP Output for your tests!

- GitHub Workflow Commands Documentation <https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-error-message>: For more information about the output syntax.

AUTHOR

Jose, D. Gomez R. <1josegomezr [AT] gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2023 by Jose D. Gomez R.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.38.0 or, at your option, any later version of Perl 5 you may have available.

2023-12-08 perl v5.38.2