Revert Sonar to old way (#1124)

This commit is contained in:
Stef Heyenrath
2024-06-19 18:21:37 +02:00
committed by GitHub
parent 61937db0b3
commit 2602db566b

View File

@@ -14,42 +14,53 @@ jobs:
echo "BuildId = $(buildId)" echo "BuildId = $(buildId)"
displayName: 'Print buildId' displayName: 'Print buildId'
- script: | - task: UseDotNet@2
dotnet tool install --global dotnet-sonarscanner displayName: Use .NET 8.0
displayName: 'Install SonarScanner tool' inputs:
packageType: 'sdk'
version: '8.0.x'
- task: PowerShell@2 - task: PowerShell@2
displayName: "Use JDK17 by default" displayName: "Use JDK11 by default"
inputs: inputs:
targetType: 'inline' targetType: 'inline'
script: | script: |
$jdkPath = $env:JAVA_HOME_17_X64 $jdkPath = $env:JAVA_HOME_11_X64
Write-Host "##vso[task.setvariable variable=JAVA_HOME]$jdkPath" Write-Host "##vso[task.setvariable variable=JAVA_HOME]$jdkPath"
- script: | - script: |
dotnet dev-certs https --trust || true dotnet dev-certs https --trust || true
displayName: 'dotnet dev-certs https' displayName: 'dotnet dev-certs https'
- script: | - task: SonarCloudPrepare@1
dotnet sonarscanner begin /k:"WireMock-Net_WireMock.Net" /o:"wiremock-net" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.token="$(SONAR_TOKEN)" /d:sonar.dotnet.excludeTestProjects=true /d:sonar.cs.opencover.reportsPaths=**/coverage.net8.0.opencover.xml /d:sonar.verbose=true displayName: 'Prepare analysis on SonarCloud'
displayName: 'Begin analysis on SonarCloud'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
inputs:
SonarCloud: SonarCloud
organization: wiremock-net
projectKey: 'WireMock-Net_WireMock.Net'
projectName: 'WireMock.Net'
extraProperties: |
sonar.cs.opencover.reportsPaths=**/coverage.net8.0.opencover.xml
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
displayName: 'Build Unit tests' displayName: 'Build Unit tests'
inputs: inputs:
command: 'build' command: 'build'
projects: './test/WireMock.Net.Tests/WireMock.Net.Tests.csproj' projects: './test/WireMock.Net.Tests/WireMock.Net.Tests.csproj'
arguments: '--configuration Debug --framework net8.0 --no-incremental' arguments: '--configuration Debug --framework net8.0'
- task: CmdLine@2 - task: CmdLine@2
inputs: inputs:
script: 'dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --no-build --configuration Debug --framework net8.0' script: 'dotnet test ./test/WireMock.Net.Tests/WireMock.Net.Tests.csproj --no-build --configuration Debug --framework net8.0'
displayName: 'Execute Unit Tests with Coverage' displayName: 'Execute Unit Tests with Coverage'
- task: SonarCloudAnalyze@1
displayName: 'SonarCloud: Run Code Analysis'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
- script: | - task: SonarCloudPublish@1
dotnet sonarscanner end /d:sonar.token="$(SONAR_TOKEN)" displayName: 'SonarCloud: Publish Quality Gate Result'
displayName: 'End analysis on SonarCloud'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) # Do not run for PullRequests
- task: whitesource.ws-bolt.bolt.wss.WhiteSource Bolt@19 - task: whitesource.ws-bolt.bolt.wss.WhiteSource Bolt@19