SonarCloud

This commit is contained in:
Stef Heyenrath
2020-11-28 13:00:04 +01:00
parent 3829a5a7f9
commit f0bddf0604
3 changed files with 12 additions and 5 deletions

View File

@@ -32,15 +32,22 @@ steps:
# - https://github.com/Microsoft/vsts-tasks/issues/8291
#
- script: |
%USERPROFILE%\.dotnet\tools\dotnet-sonarscanner begin /k:"wiremock" /o:"stefh-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /v:"$(buildId)" /d:sonar.cs.opencover.reportsPaths="**\coverage.opencover.xml"
%USERPROFILE%\.dotnet\tools\dotnet-sonarscanner begin /k:"wiremock" /o:"stefh-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /v:"$(buildId)" /d:sonar.cs.opencover.reportsPaths="./test/WireMock.Net.Tests/coverage.opencover.xml"
displayName: Begin SonarScanner
condition: and(succeeded(), eq(variables['RUN_SONAR'], 'yes'))
# Build source, tests and run tests for net452 and netcoreapp3.1 (with coverage)
- task: DotNetCoreCLI@2
displayName: Build Debug
inputs:
command: 'build'
arguments: /p:Configuration=Debug
projects: $(buildProjects)
# Build tests and run tests for net452 and netcoreapp3.1 (with coverage)
- script: |
dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --configuration Debug --framework net452
dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --configuration Debug --framework netcoreapp3.1 --logger trx /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
displayName: 'Build source, tests and run tests for net452 and netcoreapp3.1 (with coverage)'
displayName: 'Build tests and run tests for net452 and netcoreapp3.1 (with coverage)'
# End SonarScanner
- script: |