Skip to content

Commit

Permalink
ci: fixing code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
raffreitas committed Dec 15, 2024
1 parent a0c7c55 commit 20efe25
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,7 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"raffreitas_my-recipes" /o:"raffreitas-1" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml"
.\.sonar\scanner\dotnet-sonarscanner begin /k:"raffreitas_my-recipes" /o:"raffreitas-1" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths=tests\**\*.Tests\coverage.opencover.xml
dotnet build
dotnet test --no-build --collect:"XPlat Code Coverage" --results-directory ./TestResults
$reportPath = Get-ChildItem -Path ./TestResults -Filter coverage.cobertura.xml -Recurse | Select-Object -First 1
dotnet tool install --global dotnet-reportgenerator-globaltool
reportgenerator -reports:$reportPath.FullName -targetdir:./TestResults/CoverageReport -reporttypes:OpenCover
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover -l trx
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 comments on commit 20efe25

Please sign in to comment.