actions-rs / meta

🦀 GitHub Actions for Rust - recipes, discussions, questions and ideas
https://github.com/actions-rs
Creative Commons Zero v1.0 Universal
353 stars 15 forks source link

Action for generating coverage reports #1

Open garyttierney opened 5 years ago

garyttierney commented 5 years ago

Is there any interest in getting support for an action that can generate code coverage reports? I have a simple thing here[1] based on https://github.com/xd009642/tarpaulin, but it's limited in that it only supports x86 Linux.

I've also had some success with grcov and rustc's profiling capabilities, which may work for other platforms.

I'd be willing to spend a bit of time getting this working.

[1]: example here with workflow.

lucasbrendel commented 4 years ago

It would be nice to carry over the behavior of cargo-travis for code coverage as well as documentation publishing to gh-pages

svartalf commented 4 years ago

@garyttierney, yes, code coverage is definitely a thing to add! I had created #2 and #3 to track progress for tarpaulin and grcov actions respectively.

@lucasbrendel I'm strongly against re-implementing coverage reports uploading; there are official coveralls and codecov Actions at the GH marketplace, it would be better to use them. Action for doc publishing looks promising, though, here is a #4 :)

lucasbrendel commented 4 years ago

@svartalf i totally get not wanting to duplicate work. So would #2 and #3 cover creating coverage reports for something like codecov and then use the codecov action to upload?

Thanks for #4

svartalf commented 4 years ago

@lucasbrendel yep, that's exactly an idea: our Actions will generate the report file and you can do whatever you want with it later: upload to the coveralls/codecov, convert into the .html report with genhtml or anything else. That approach is more flexible and will allow to build more complex workflows.

If you are interested, you can check the @actions-rs/grcov "dev" branch and this example, which gathers code coverage reports from the multiple parallel builds and uploads them to the coveralls service. I should warn, though, that it is not even in "alpha" state yet, so things might break eventually, but at least it can show what I mean.