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.
It also supports trigerring action using API with coverage dump passed as payload
Total Coverage: 99.39%
Coverage Report
File | Branches | Funcs | Lines | Uncovered Lines |
---|---|---|---|---|
src | ||||
i18n.tsx | 100% | 100% | 100% | |
src/components/i18n | ||||
context.tsx | 100% | 100% | 100% | |
hydrate.tsx | 100% | 100% | 100% | |
index.tsx | 85.71% | 88.89% | 100% | 54 |
link.tsx | 100% | 100% | 100% | |
src/components/icon | ||||
index.tsx | 100% | 100% | 100% | |
props.tsx | 100% | 100% | 100% | |
src/components/layout | ||||
index.tsx | 100% | 100% | 100% | |
src/components/release-artist-link | ||||
index.tsx | 66.67% | 100% | 100% | 24, 25, 26 |
src/components/release-companies | ||||
index.tsx | 100% | 100% | 100% | |
src/components/release-credits | ||||
index.tsx | 85.71% | 100% | 91.30% | 37, 38, 40, 43 |
src/components/release-format-link | ||||
index.tsx | 100% | 100% | 100% | |
src/components/release-header | ||||
index.tsx | 58.33% | 100% | 100% | 79, 80, 82, 85, 86 |
src/components/release-label-link | ||||
index.tsx | 100% | 100% | 100% | |
src/components/release-series-link | ||||
index.tsx | 0% | 100% | 100% | 19 |
src/components/release-thumbnail | ||||
icon.tsx | 50% | 100% | 83.33% | 26, 30 |
index.tsx | 75% | 100% | 100% | 42 |
src/components/search | ||||
index.tsx | 100% | 100% | 100% | |
mock.tsx | 100% | 100% | 100% | |
ui.tsx | 100% | 100% | 100% | |
src/lib | ||||
add-state.tsx | 100% | 100% | 100% | |
intersperse.tsx | 100% | 100% | 100% | |
keycodes.tsx | 100% | 100% | 100% | |
slug.tsx | 100% | 100% | 100% | |
src/services | ||||
autocomplete.tsx | 100% | 100% | 100% |
Github token used for posting the comment. To use the key provided by the GitHub
action runner, use ${{ secrets.GITHUB_TOKEN }}
.
The location of the lcov file to read the coverage report from. Defaults to
./coverage/lcov.info
.
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.
Raw dump of lcov data
Comment results on specific PR based (if triggered using API)
# Creates a PR comment
name: Coverage
# Controls when the action will run.
on:
repository_dispatch:
types: [tests_completed]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Report coverage
uses: ayushgaud/lcov-reporter-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-dump: ${{ github.event.client_payload.lcovDump }}
pull-request-id: ${{ github.event.client_payload.PR }}
export LCOV_DUMP=$(cat lcov.info | jq -aRs .)
curl --request POST --url 'https://api.github.com/repos/$ORG/$REPO/dispatches' -H"Accept: application/vnd.github.v3+json" -H"authorization: token $GH_TOKEN" --data '{"event_type": "tests_completed", "client_payload": {"PR":'$TRAVIS_PULL_REQUEST', "lcovDump":'$LCOV_DUMP'}}'
The initial code is based on ziishaned/jest-reporter-action.