github-action
github-action copied to clipboard
Add support for glob patterns in path-to-lcov
Would it be possible to add support for glob patterns in path-to-lcov
?
The tool stack I'm using generates the lcov
inside a folder named as a GUID. Not having to specify it would be very helpful.
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./TestResults/**/coverage.info
Definitely would be useful. Might make a PR for this. Are the maintainers interested in this?
I agree this would be a useful feature. For reference, a GUID directory name is unavoidable with Coverlet on .NET due to coverlet-coverage/coverlet#500. Coverlet is a popular coverage framework that may be worth supporting well.
Until/Unless it is implemented, a workaround I'm using is to pass the lcov path as a step output:
- name: Get path to lcov file
id: get_lcov_path
shell: bash
run: printf '::set-output name=lcov_path::%s\n' TestResults/*/coverage.info
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ${{ steps.get_lcov_path.outputs.lcov_path }}
Where run: printf ...
could be replaced with any command(s) which print the ::set-output
workflow command with the desired path. Note that if multiple ::set-output
lines are printed, all but the last are ignored.
@kevinoid You're solution is great! I'm trying to use it but Coveralls is giving me 0% coverage. Running coverlet from the command line, I can see that the coverage.info contains data. The GitHub Actions also does not report any problem. Do you have any tip?
@aalmada Is "0% coverage" shown in the output coverlet produces, or does coverlet show a non-zero value that appears as 0% in coveralls? If it's the former, you may want to check coverlet troubleshooting and/or open an issue with coverlet. If it's the later, you may want to open a separate issue to investigate.