Kotlin / kotlinx-kover

Apache License 2.0
1.27k stars 47 forks source link

Add markdown summary report #419

Closed efenderbosch-atg closed 3 weeks ago

efenderbosch-atg commented 11 months ago

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 commented 11 months ago

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 commented 10 months ago

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
shanshin commented 3 weeks ago

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