py-cov-action / python-coverage-comment-action

Publish coverage report as PR comment, and create a coverage badge & dashboard to display on the Readme for Python projects, all inside GitHub without third party servers
https://github.com/marketplace/actions/python-coverage-comment
MIT License
70 stars 26 forks source link

PNG badges in coverage comment #414

Closed ewjoachim closed 1 week ago

ewjoachim commented 1 month ago

Closes #371

github-actions[bot] commented 1 month ago

End-to-end public repo

Admin commands cheatsheet:

ewjoachim commented 1 month ago
Screenshot 2024-05-26 at 10 11 41

The good news is that the images appear in the gmail notification. The bad news is that it's a pixel garbage mess, barely readable (on a retina display).

ewjoachim commented 1 month ago

Of course, the github version is a mess too

Screenshot 2024-05-26 at 10 14 55
github-actions[bot] commented 1 month ago

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  coverage_comment
  badge.py
  template.py
Project Total  

This report was generated by python-coverage-comment-action

ewjoachim commented 1 month ago

Here's the comment that was posted:

Coverage report (my-great-project)

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  subdir/end_to_end_tests_repo
  __init__.py
Project Total  

This report was generated by python-coverage-comment-action

ewjoachim commented 1 month ago
<img src="https://img.shields.io/badge/Coverage%20evolution-83%25%20%3E%2091%25-brightgreen.png">

This would be with srtset 2x:

<img srcset="https://img.shields.io/badge/Coverage%20evolution-83%25%20%3E%2091%25-brightgreen.png 2x" src="https://img.shields.io/badge/Coverage%20evolution-83%25%20%3E%2091%25-brightgreen.png">

(it doesn't display)

ewjoachim commented 1 month ago

Ah ? https://github.blog/changelog/2022-05-19-specify-theme-context-for-images-in-markdown-beta/

Let's investigate!

ewjoachim commented 1 month ago
<picture>
  <source media="(min-resolution: 2dppx)" srcset="https://webkit.org/demos/srcset/image-2x.png">
  <img src="https://webkit.org/demos/srcset/image-1x.png">
</picture>

Doesn't work for me: the image loads when I open the PR, but when I reload, it disappears.

ewjoachim commented 1 week ago

Closing for now.