I am trying to get the Code Analysis done with SonarCloud using the Github actions for my .NET Core application. I have added the below code in my build.yml file for .NET Core Build & Test to check if Code Coverage is populating in SonarCloud.io,
.\.sonar\scanner\dotnet-sonarscanner begin /k:"projectkey" /o:"organization" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vstest.reportsPaths=**\*.trx /d:sonar.cs.vscoveragexml.reportsPaths=**\*.coveragexml
dotnet build --configuration Release
dotnet test -c release --no-build UnitTest/UnitTest.csproj --collect "Code Coverage" --logger trx
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
In the GitHub Actions log able to see the below line
D:\a\DevOpsStarterMvc\DevOpsStarterMvc\Application\aspnet-core-dotnet-core.UnitTests\TestResults\4078eefd-c66e-4ee4-a847-b322df1f407f\runneradmin_fv-az450-602_2022-03-23.10_39_01.coverage
Which is generating .coverage file and the github run on windows-latest instance. But I am seeing 0.0% for the Coverage in the SonarCloud’s Project Summary. On checking logs in actions, found the below line which is looking for the converted .coveragexml file where no log message stating convertion is completed.
WARN: Could not find any coverage report file matching the pattern '$(Agent.TempDirectory)***.coveragexml'.