coverallsapp / coverage-reporter

Self-contained, universal coverage uploader binary. Under development.
https://coveralls.io
MIT License
45 stars 14 forks source link

Add way to specify coverage file format #36

Closed kevinoid closed 1 year ago

kevinoid commented 1 year ago

:zap: Summary

It would be great if the coverage reporter had a way to specify the format of the coverage file, rather than relying on detection from the filename.

Background

After upgrading from coverallsapp/github-action@v1 to coverallsapp/github-action@v2 my .NET projects which use coverlet to produce coverage results in lcov format fail to upload the coverage to coveralls with an error similar to the following:

⚠️ Coverage reporter does not yet know how to process this file: NetCoreProject.UnitTests/TestResults/a4c52cc8-0a0c-4d2e-aacd-e6aa12cdeef6/coverage.info

Example with v1 and with v2.

This occurs because coverage.info does not match the filename patterns coverage-reporter expects. Unfortunately, it's not possible to change the name produced by coverlet (see https://github.com/coverlet-coverage/coverlet/issues/1276 ) so an extra build step is currently required to rename coverage.info to lcov.info to satisfy coverage-reporter. It would be great if there were a way to avoid this hassle.

mrexox commented 1 year ago

Hey! Thank you for the issue. I've recently released a new version of coverage-reporter and updated Github action v2 tag. Now you can specify format: lcov, and the reporter should use it to parse the report.

Now this setup should work:

- uses: coverallsapp/github-action@v2
  with:
    file:  NetCoreProject.UnitTests/TestResults/a4c52cc8-0a0c-4d2e-aacd-e6aa12cdeef6/coverage.info
    format: lcov

Please, feel free to reopen this issue or open a new one if you face any problems.

kevinoid commented 1 year ago

Looks perfect! Thanks for the lightning-fast fix @mrexox!