kotlinx-kover icon indicating copy to clipboard operation
kotlinx-kover copied to clipboard

Add markdown summary report

Open efenderbosch-atg opened this issue 1 year ago • 2 comments

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)

efenderbosch-atg avatar Jun 29 '23 16:06 efenderbosch-atg

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)

efenderbosch-atg avatar Jun 29 '23 22:06 efenderbosch-atg

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

efenderbosch-atg avatar Jul 12 '23 13:07 efenderbosch-atg

Closed in favor of https://github.com/Kotlin/kotlinx-kover/issues/605

shanshin avatar May 10 '24 13:05 shanshin