Skip to content

castorverhoog/lcov-reporter-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

102 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jest 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.

Example output coverage report

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%

Example output difference table

Coverage after merging feat/test into master

57.61%▾ -2.87%

Coverage Report
FileBranchesFuncsLines
src/js/dashboard/Components/Settings/Animation
   Animation.js18/22 0/2281.82% 0%11/13 0/1384.62% 0%24/29 0/2982.76% 0%
src/js/dashboard/Components/Settings/Label
   Label.js3/5 2/560% 40%4/4 3/4100% 75%12/12 9/12100% 75%
src/js/dashboard/Components/Settings/MenuStyle
   MenuStyle.js5/17 0/1729.41% 0%4/4 0/4100% 0%15/24 0/2462.50% 0%
src/js/dashboard/Components/Settings/Position
   Position.js50/59 0/5984.75% 0%13/13 0/13100% 0%34/42 1/4280.95% 2.38%
src/js/dashboard/Components/Settings/StartOpened
   StartOpened.js0/0 0/0100% 100%3/3 2/3100% 66.67%6/6 4/6100% 66.67%
src/js/dashboard/Components/Settings/Visibility
   Visibility.js4/6 2/666.67% 33.33%4/4 2/4100% 50%12/12 6/12100% 50%
src/js/dashboard/Pages/Group/Tabs
   Options.js14/21 7/2166.67% 33.33%16/17 5/1794.12% 29.41%26/29 11/2989.66% 37.93%

Or, without fractions:

Coverage after merging feat/test into master

57.61%▾ -2.87%

Coverage Report
FileBranchesFuncsLines
src/js/dashboard/Components/Settings/Animation
   Animation.js81.82% 0%84.62% 0%82.76% 0%
src/js/dashboard/Components/Settings/Label
   Label.js60% 40%100% 75%100% 75%
src/js/dashboard/Components/Settings/MenuStyle
   MenuStyle.js29.41% 0%100% 0%62.50% 0%
src/js/dashboard/Components/Settings/Position
   Position.js84.75% 0%100% 0%80.95% 2.38%
src/js/dashboard/Components/Settings/StartOpened
   StartOpened.js100% 100%100% 66.67%100% 66.67%
src/js/dashboard/Components/Settings/Visibility
   Visibility.js66.67% 33.33%100% 50%100% 50%
src/js/dashboard/Pages/Group/Tabs
   Options.js66.67% 33.33%94.12% 29.41%89.66% 37.93%

Inputs

github-token (Required)

Github token used for posting the comment. To use the key provided by the GitHub action runner, use ${{ secrets.GITHUB_TOKEN }}.

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.

Example usage

uses: romeovs/lcov-reporter-action@v0.2.16
with:
  github-token: ${{ secrets.GITHUB_TOKEN }}
  lcov-file: ./coverage/lcov.info

Acknowledgements

The initial code is based on ziishaned/jest-reporter-action.

About

Comments a pull request with the jest code coverage

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%