-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
65 lines (45 loc) · 1.96 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
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
# Build environment, just select the Microsoft-hosted agent, without needing to set up any infrastructure of your own.
pool:
vmImage: 'Ubuntu-16.04'
# other options: 'macOS-10.13', 'vs2017-win2016'
variables:
buildConfiguration: 'Release'
steps:
- script: dotnet restore src
displayName: 'Prepare - Restore nuget packages'
- script: dotnet build src --configuration $(buildConfiguration) --no-restore
displayName: 'Build - $(buildConfiguration)'
- script: dotnet test src --configuration $(buildConfiguration) --logger trx
displayName: 'Test'
# @ means version
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
- script: dotnet test src --configuration $(buildConfiguration) --logger trx --collect "Code coverage"
- task: PublishTestResults@2
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx'
# Data collector 'Code Coverage' message: No code coverage data available. Code coverage is currently supported only on Windows..
# https://docs.microsoft.com/en-us/azure/devops/pipelines/languages/dotnet-core?view=azure-devops&tabs=yaml#collect-code-coverage
# - script: dotnet publish src --configuration $(buildConfiguration) --no-restore --no-build --output $BUILD_ARTIFACTSTAGINGDIRECTORY
# displayName: 'Publish'
# Publish to Azure App Service
- task: DotNetCoreCLI@2
inputs:
command: publish
publishWebProjects: True
arguments: '--configuration $(buildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: True
# Publish with Artifacts
- task: PublishBuildArtifacts@1
# Publish to Linux VM
# https://docs.microsoft.com/en-us/azure/devops/pipelines/apps/cd/deploy-linuxvm-deploygroups?view=azure-devops