Skip to content
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

Add code coverage report to unit-tests.yml GitHub Action #24

Open
AndyLPK247 opened this issue Oct 23, 2020 · 1 comment
Open

Add code coverage report to unit-tests.yml GitHub Action #24

AndyLPK247 opened this issue Oct 23, 2020 · 1 comment
Labels
github-actions GitHub Actions

Comments

@AndyLPK247
Copy link
Contributor

This is a follow-up to #18. It would be nice to run code coverage and share the report.

Check out this article:
https://codeburst.io/code-coverage-in-net-core-projects-c3d6536fd7d7

Questions:

  • What code coverage tool should we use?
  • Where should the report be published? (in the log, uploaded elsewhere, etc.)
  • Is code coverage worthwhile for this project?
@AutomationPanda AutomationPanda added the hacktoberfest Recommended for Hacktoberfest label Sep 30, 2021
@AutomationPanda AutomationPanda added the github-actions GitHub Actions label Oct 21, 2021
@AutomationPanda AutomationPanda removed the hacktoberfest Recommended for Hacktoberfest label Nov 2, 2021
@CoffeeAtBedtime
Copy link
Contributor

CoffeeAtBedtime commented Dec 4, 2022

In this article https://samlearnsazure.blog/2021/01/05/code-coverage-in-github-with-net-core/
the output format for coverlet is set to lcov and he adds it to the pipeline

`- name: Run automated unit and integration tests
  run: dotnet test FeatureFlags/FeatureFlags.Tests/FeatureFlags.Tests.csproj  /p:CollectCoverage=true /p:CoverletOutput=TestResults/ /p:CoverletOutputFormat=lcov`

Sends it up to https://coveralls.io

`- name: Publish coverage report to coveralls.io   
  uses: coverallsapp/github-action@master   
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }} 
    path-to-lcov: FeatureFlags/FeatureFlags.Tests/TestResults/coverage.info`

Then has a nice coverage badge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github-actions GitHub Actions
Projects
None yet
Development

No branches or pull requests

4 participants