-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for doing code coverage reporting entirely on GitHub #189
Comments
Yes, please!!! |
It's unlikely I am getting to this anytime soon if anyone else wants to take a run at it. |
Looks like pydata-sphinx-theme did the hard work here (uses https://github.com/py-cov-action/python-coverage-comment-action):
Though, @weaverba137 also said Coveralls still work (at least for DESI), if that is preferable. I don't quite remember now why we switched from Coveralls to Codecov in the first place. (Something was broken?) |
That said, given how much my attempt at #199 broke other repos running CI in different ways, maybe it is better for |
Why don't we just try and figure it out in the reusable workflows then we would get it to work in all coordinated packages etc too for free? |
It would be a breaking change. I see very specific codecov settings. |
There's a generic |
From the coverage.py docs I just found this: https://github.com/Bachmann1234/diff_cover we could use that to fail the job based on the patch coverage rather than the whole project. |
here's a usage of report_diff_coverage:
needs: [ test ]
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
- run: pip install diff-cover coverage
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: pip install .
- uses: actions/download-artifact@v4
with:
pattern: ".coverage*"
merge-multiple: true
- run: coverage xml
- run: diff-cover coverage.xml --compare-branch origin/${{ github.base_ref }} --markdown-report $GITHUB_STEP_SUMMARY |
made it even better by having it comment the report on the PR and update that comment with every commit. However, it requires using report_diff_coverage:
needs: [ test ]
if: github.event_name == 'pull_request_target'
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: 3
- run: pip install diff-cover coverage
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: pip install .
- uses: actions/download-artifact@v4
with:
pattern: ".coverage*"
merge-multiple: true
- run: coverage xml
- run: diff-cover coverage.xml --compare-branch origin/${{ github.base_ref }} --markdown-report diff_coverage.md
- run: cat diff_coverage.md >> $GITHUB_STEP_SUMMARY
- uses: thollander/[email protected]
with:
filePath: diff_coverage.md
pr_number: ${{ github.event.number }}
comment_tag: diff-coverage |
Re: pull_request_target -- I can always test on my astropy fork instead of astropy proper in that case. tl;dr -- Does it report patch coverage, or just project? |
Actually, I have concern... Please see https://github.com/astropy/astropy/pull/16619/files#r1655466104 |
It seems not that complex to upload a coverage report from each job and then combine them in an extra job: https://hynek.me/articles/ditch-codecov-python/ I am finding codecov to be more and more annoying so it might be worth having a second option?
The text was updated successfully, but these errors were encountered: