.Net GitHub Actions 0% coverage

Hello,

I use github action run SonarCloud Code Analysis but I get 0% Coverage.
Repository : GitHub - numeriquerelais/NumerologicalLifePath
PR : Feat(CI) : Add Test coverage to Sonar Analysis · numeriquerelais/NumerologicalLifePath@5f31ebb · GitHub
My current workflow config : NumerologicalLifePath/.github/workflows/build-validation.yml at feat/AddCLI · numeriquerelais/NumerologicalLifePath · GitHub
My sonarcould pullrequest : SonarCloud

I don’t understand why. Have you any idea please ?

Hi,

Welcome to the community!

You’ve provided the link to a PR. Are you basing your “0% coverage” assertion on that? Because based on the PR analysis, there were no code changes in the PR. No code means nothing coverable means no coverage by default.

Your pipeline looks almost exactly like the docs (except for single versus double quotes) so I would expect it to work. Can you try this again with some code changes?

 
Ann

Hi @numeriquerelais,

Looking at your workflow, it seems you forgot to include the option giving the scanner the path to the coverage file:
/d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
This option must be passed to the scanner in the begin step. Of course make sure the path corresponds to your specific setup…

Denis

Thank you so much. Effectively, with 1 change in source code it’s works.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.