-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
96 lines (81 loc) · 2.69 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- main
pool:
vmImage: ubuntu-latest
variables:
buildConfiguration: 'Release'
azureSubscription:
steps:
- task: DockerCompose@0
displayName: Start dependencies (docker-compose)
inputs:
containerregistrytype: Container Registry
dockerComposeFile: docker-compose.actions.yml
dockerComposeCommand: 'up -d'
- task: UseDotNet@2
inputs:
packageType: 'sdk'
versions: '3.1.x'
- task: DotNetCoreCLI@2
inputs:
command: 'restore'
projects: '**/*.csproj'
feedsToUse: 'select'
displayName: dotnet restore
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '**/*.csproj'
arguments: '--no-restore --configuration $(buildConfiguration)'
displayName: 'dotnet build $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'Install .NET Core tools from local manifest'
inputs:
command: custom
custom: tool
arguments: 'restore'
- task: DotNetCoreCLI@2
inputs:
command: test
projects: '**/UnitTests.Desorganizze.csproj'
arguments: '--no-build -c $(buildConfiguration) -v normal /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=$(Build.SourcesDirectory)/TestResults/Coverage/'
publishTestResults: true
displayName: 'Running Unit Tests'
- task: DotNetCoreCLI@2
inputs:
command: test
projects: '**/FunctionalTests.Desorganizze.csproj'
arguments: '--no-build -c $(buildConfiguration) -v normal'
displayName: 'Running Functional Tests'
- task: DotNetCoreCLI@2
displayName: 'Create code coverage report'
inputs:
command: custom
custom: tool
arguments: 'run reportgenerator -reports:$(Build.SourcesDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage -reporttypes:HtmlInline_AzurePipelines'
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage report'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '$(Build.SourcesDirectory)/**/coverage.cobertura.xml'
- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: True
displayName: 'dotnet publish'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifactName: 'DesorganizzeWebApp'
- task: AzureWebApp@1
condition: succeeded()
inputs:
azureSubscription: 'desorganizze-service-connection'
appName: 'desorganizze'
package: '$(Build.ArtifactStagingDirectory)/**/*.zip'