kotlinx-kover
kotlinx-kover copied to clipboard
Add markdown summary report
What is your use-case and why do you need this feature?
I'd like a kover/report.md
that would be appropriate for use as a PR comment via github actions, just the "Overall Coverage Summary" from the HTML report would be great.
Maybe I can grab the HTML? Git hub will format it like this:
Package | Class, % | Method, % | Branch, % | Line, % | Instruction, % |
---|---|---|---|---|---|
all classes | 97.5% (79/81) | 94.3% (181/192) | 89.4% (93/104) | 98.4% (569/578) | 98.4% (3388/3443) |
As markdown it could look like
foo-project: Overall Coverage Summary
Package | Class, % | Method, % | Branch, % | Line, % | Instruction, % |
---|---|---|---|---|---|
all classes | 97.6% (80/82) | 94.1% (176/187) | 88.8% (87/98) | 98.5% (543/551) | 97.2% (3258/3351) |
For now, I'm converting to markdown w/ pandoc
and grabbing the summary w/ sed
as a workaround:
pandoc build/reports/kover/html/index.html -f html -t gfm | \
sed -n '/# foo-bar-service: Overall Coverage Summary/,/## Coverage Breakdown/p' | \
grep -v '## Coverage Breakdown' >> $GITHUB_STEP_SUMMARY
Closed in favor of https://github.com/Kotlin/kotlinx-kover/issues/605