github-action icon indicating copy to clipboard operation
github-action copied to clipboard

Add support for glob patterns in path-to-lcov

Open aalmada opened this issue 4 years ago • 4 comments

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 

aalmada avatar Jan 31 '20 23:01 aalmada

Definitely would be useful. Might make a PR for this. Are the maintainers interested in this?

aaomidi avatar Mar 13 '20 20:03 aaomidi

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 avatar Dec 08 '20 22:12 kevinoid

@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 avatar Feb 28 '21 23:02 aalmada

@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.

kevinoid avatar Mar 01 '21 04:03 kevinoid