Skip to content

Commit eb4701f

Browse files
committed
Set up CI with Azure Pipelines
[skip ci]
1 parent 0877f2b commit eb4701f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

adt_pull_request.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# ASP.NET Core
2+
# Build and test ASP.NET Core projects targeting .NET Core.
3+
# Add steps that run tests, create a NuGet package, deploy, and more:
4+
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
5+
6+
#trigger:
7+
#- version-5
8+
9+
pool:
10+
vmImage: windows-latest
11+
12+
variables:
13+
buildConfiguration: 'Release'
14+
prPipeline: $[eq(variables['Build.Reason'], 'PullRequest')]
15+
16+
steps:
17+
- script: dotnet build --configuration $(buildConfiguration)
18+
displayName: 'dotnet build $(buildConfiguration)'
19+
20+
- task: DotNetCoreCLI@2
21+
displayName: Rodando os testes da aplicação
22+
inputs:
23+
command: test
24+
projects: '**/*[Tt]ests/*.csproj'
25+
arguments: '--configuration $(BuildConfiguration) --collect "Code Coverage"'
26+
27+
- task: DotNetCoreCLI@2
28+
displayName: 'Rodando SonarScanner '
29+
inputs:
30+
command: custom
31+
custom: tool
32+
arguments: |
33+
'dotnet sonarscanner begin /k:"$(SONAR_PROJECT_KEY)" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$(SONAR_TOKEN)" /d:sonar.cs.dotcover.reportsPaths=dotCover.Output.html
34+
dotnet build –no-incremental
35+
dotnet dotcover test --dcReportType=HTML
36+
dotnet sonarscanner end /d:sonar.login="$(SONAR_TOKEN)"'

0 commit comments

Comments
 (0)