Created
August 17, 2021 18:55
-
-
Save Andras-Csanyi/08a8458aff8b67723cd38a4c2db58860 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- stage: Feature_branch | |
condition: ne(variables['System.PullRequest.SourceBranch'], '') | |
jobs: | |
- job: sonar_scan | |
displayName: Sonar scan | |
steps: | |
- script: | | |
dotnet sonarscanner begin \ | |
/k:"Guards" \ | |
/d:sonar.host.url=$(sonar.host.url) \ | |
/d:sonar.login=$SONAR_LOGIN_NAME \ | |
/o:$(sonar.organization) \ | |
/s:../s/sonar.xml \ | |
/d:sonar.pullrequest.key=$(System.PullRequest.PullRequestNumber) \ | |
/d:sonar.pullrequest.branch=$(System.PullRequest.SourceBranch) \ | |
/d:sonar.pullrequest.base=main \ | |
/d:sonar.pullrequest.provider=GitHub \ | |
/d:sonar.pullrequest.github.repository=EncyclopediaGalactica/Guards | |
env: | |
SONAR_LOGIN_NAME: $(sonar.login) | |
- job: restore_solution | |
displayName: Restore solution | |
dependsOn: sonar_scan | |
steps: | |
- script: dotnet restore $solutionName | |
- job: build_solution | |
displayName: Build solution | |
dependsOn: restore_solution | |
steps: | |
- script: dotnet build $solutionName $debugBuild | |
- job: test_solution | |
displayName: Test and Coverage | |
dependsOn: build_solution | |
steps: | |
- script: | | |
dotnet dotcover test \ | |
--no-build \ | |
--dotCoverReportType=html | |
- job: sonar_end | |
dependsOn: test_solution | |
displayName: Sonar End | |
steps: | |
- script: | | |
dotnet sonarscanner end /d:sonar.login=$(sonar.login) | |
env: | |
SONAR_LOGIN_NAME: $(sonar.login) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment