Skip to content

Latest commit

 

History

History
48 lines (31 loc) · 10.4 KB

README.md

File metadata and controls

48 lines (31 loc) · 10.4 KB

Lcov reporter action

This action comments a pull request with a HTML test coverage report. The report is based on the lcov coverage report generated by your test runner. Note that this action does not run any tests, but instead expects the tests to have been run by another action already.

This fork is specifically made to support run as a seperate action (triggered by workflow_run) to be able to comment on PRs not made by people with write access to the repo. For more information, see https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

Example output

Total Coverage: 99.39%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
src
   i18n.tsx100%100%100%
src/components/i18n
   context.tsx100%100%100%
   hydrate.tsx100%100%100%
   index.tsx85.71%88.89%100%54
   link.tsx100%100%100%
src/components/icon
   index.tsx100%100%100%
   props.tsx100%100%100%
src/components/layout
   index.tsx100%100%100%
src/components/release-artist-link
   index.tsx66.67%100%100%24, 25, 26
src/components/release-companies
   index.tsx100%100%100%
src/components/release-credits
   index.tsx85.71%100%91.30%37, 38, 40, 43
src/components/release-format-link
   index.tsx100%100%100%
src/components/release-header
   index.tsx58.33%100%100%79, 80, 82, 85, 86
src/components/release-label-link
   index.tsx100%100%100%
src/components/release-series-link
   index.tsx0%100%100%19
src/components/release-thumbnail
   icon.tsx50%100%83.33%26, 30
   index.tsx75%100%100%42
src/components/search
   index.tsx100%100%100%
   mock.tsx100%100%100%
   ui.tsx100%100%100%
src/lib
   add-state.tsx100%100%100%
   intersperse.tsx100%100%100%
   keycodes.tsx100%100%100%
   slug.tsx100%100%100%
src/services
   autocomplete.tsx100%100%100%

Inputs

github-token (Optional)

Github token used for posting the comment. Defaults to ${{ github.token }}.

pr-number (Required)

Number of the Pull Request.

lcov-file (Optional)

The location of the lcov file to read the coverage report from. Defaults to ./coverage/lcov.info.

lcov-base (Optional)

The location of the lcov file resulting from running the tests in the base branch. When this is set a diff of the coverage percentages is shown.

hide-branch-coverage (Optional)

Hides the branch coverage in the output if set to true

output-file (Optional)

Filename to output the html to. If set the action will not comment on the PR.

Example usage

Note: You need to somehow read the pr_number into the environment.

uses: Nef10/[email protected]
with:
  lcov-file: lcov.info
  pr-number: ${{ env.pr_number }}

Acknowledgements

The code is based on romeovs/lcov-reporter-action, which itself was based on ziishaned/jest-reporter-action.