-
Notifications
You must be signed in to change notification settings - Fork 74
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
Can I use only LCOV files? #30
Comments
I have the same question. I'm trying to migrate from Travis to GitHub Actions and I have a cobertura.xml file generated by sbt-scoverage but I can't seem to find a way to convert it to LCOV. Previously I used sbt-coveralls, but they don't support GitHub Actions and I'd rather use the officially supported action anyway. Would it be a possibility to support some of the most common coverage formats? |
Hi guys. I've the same problem with my python application. Do you've a solution to solve this? |
Hi moonkwoo, to solve I used this tip: https://github.com/aodj/icelandreview/blob/master/.github/workflows/pythonpackage.yml#L30 |
The solution provided by @riquellopes works. A solution that either converts python-coverage to |
@nickmerwin Could you give us an example how to use the coverage repo generated by |
@SVilgelm that output is not supported by this GitHub action (LCOV only) and requires using the |
@nickmerwin are there any plans from Coveralls to officially maintain and/or add new features to this, or was this just an experiment? |
no update in months and limited functionality... kind of a shame since the github actions are nice but I guess for tests we can't really rely on this |
Oh well looks like I'm ditching coveralls for codecov. It's a shame I like coveralls, but if forked PRs aren't supported with GitHub actions/pytest then its not viable for my, and I imagine lots of others, use cases |
I made it work and wrote an action for it https://github.com/marketplace/actions/coveralls-python |
Coveralls.io cannot be easily used by GitHub Actions because the secret token is not passed to PRs which are opened by third-party forks (#392). Furthermore, Coveralls.io's GitHub Action only supports LCOV files (coverallsapp/github-action#30). But, coverage.py generates .coverage files. Since they are roughly equivalent in functionality for our purpose, we switch from coveralls.io to CodeCov.
We also use Python with Coveralls so this is a blocker for us. Unfortunately we create PRs from forked repos which cannot access the Coveralls token secret, so there is no way to use the manual coveralls module to upload the coverage via Github Actions. |
The coveralls gem produces JSON formats, but the Coveralls GH Action seems to only support LCOV files: coverallsapp/github-action#30
Was considering switching to sonarcloud.io but they don't seem to support matrix builds very well: https://community.sonarsource.com/t/cannot-run-sonarsource-sonarcloud-github-action-master-java-not-found/14922 |
This reverts commit e660da8.
I moved all my projects to CodeCov, they added tokenless mode for GitHub Actions and it supports any type of coverage reports. |
For anyone still trying to get pytest working, I think there have been some changes to the env vars needed to run coveralls and get it to find the correct repo on coveralls.io
N.B. I have to An example configuration is here: greenelab/ponyo#11 |
So, based on OP question, only way to upload coverage in XML is to convert it to lcov format I guess ? |
@dinko-pehar the answer is yes, only LCOV. That’s for the Coveralls GitHub action on its own. It only accepts LCOV. That said, some other integrations—language specific, community-created integrations—support other coverage report formats (typically the standard more common to the language), which those integrations convert to the JSON expected by the Coveralls API. (Which is what the Coveralls GitHub Action does—converts LCOV to JSON.) if you’re working in python, check out this project: (It supports GitHub Actions for CI.) For other languages, see the Coveralls docs site and look for your language in the left-hand nav: |
I'm looking into Crystal lang. Using some coverage tools compatible with Crystal, it's able to generate cobertura.xml report. |
@dinko-pehar in that case check out Coveralls’ new Universal Coverage Reporter: It’s written in Crystal and currently has support for LCOV and SimpleCov. Maybe you can contribute a plug-in adding read-and-convert support for your standard following its model. |
That's great. I'll have a look at that and how it can be extended I hope. |
I managed to get everything working nicely using coveragepy-lcov. It requires Python 3.8+ though so if you have an older version, you may need to do a setup-python to get the correct version after running pytest. Something similar to: - name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Covert Coverage Results
run: |
pip install coveragepy-lcov
coveragepy-lcov --data_file_path .coverage --output_file_path lcov.info
- name: Upload Coverage Results
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: lcov.info EDIT: As a note, I am not able to get this to report coverage correctly to Coveralls. Coverage is always being reported as 0%. It might be an issue with |
Thanks @AngellusMortis was able to figure it out due to your post |
I also have the same problem : in Coveralls, coverage is always reported as 0% 🤔 |
The simplest was to do this - name: Test
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
pytest -s -v --cov={project} --cov-report term-missing && coveralls |
It would be great to have support for sbt as well. Currently, we do something like:
But it doesn't leave a comment this way. Would be great if we can use the official GA support for sbt. |
Migrate our sphinx domain to github actions [reviewed by @lydia-duncan] Migrate from Travis to Github Actions. Travis is no longer free (or well supported), so migrate to github actions. For the most part this is a direct transliteration of the Travis job, but the main coveralls github-action doesn't work with xml (coverallsapp/github-action#30), so switch to using codecov, which provides similar functionality. Here's some resources I used: - https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions - https://github.com/codecov/codecov-action Resolves Cray/chapel-private#1804
Hello,
My application is based on python and I use pytest-cov to create report file.
The available formats of reports file are terminal, html, xml in pytest-cov.
(c.f. https://pytest-cov.readthedocs.io/en/latest/reporting.html)
Can I use not only LCOV files but also XML, HTML to send report file to coveralls?
The text was updated successfully, but these errors were encountered: