-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
49 lines (42 loc) · 1.88 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
jobs:
- job: windows_build
pool:
vmImage: 'VS2017-Win2016'
steps:
- script: |
dotnet test src\Quamotion.Malaga.Tests\Quamotion.Malaga.Tests.csproj -l "trx;LogFileName=$(Build.ArtifactStagingDirectory)\Quamotion.Malaga.Tests.trx" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput="$(Build.ArtifactStagingDirectory)\Quamotion.Malaga.Tests.opencover.xml" /p:Include="[Quamotion.Malaga]*"
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator "-reports:$(Build.ArtifactStagingDirectory)\*.opencover.xml" "-targetdir:$(Build.ArtifactStagingDirectory)" -reporttypes:Cobertura
displayName: Test
- task: PublishTestResults@1
inputs:
testRunner: VSTest
testResultsFiles: $(Build.ArtifactStagingDirectory)/*.trx
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: $(Build.ArtifactStagingDirectory)/Cobertura.xml
failIfCoverageEmpty: true
- script: |
dotnet pack src\Quamotion.Malaga\Quamotion.Malaga.csproj -c Release -o $(Build.ArtifactStagingDirectory)
displayName: Build and pack
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: malaga
displayName: Publish Quamotion.Malaga
condition: always()
- task: NuGetToolInstaller@1
inputs:
versionSpec: '4.9.4'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: Install the latest version of NuGet
- task: NuGetCommand@2
continueOnError: true
inputs:
command: push
packagesToPush: '$(Build.ArtifactStagingDirectory)\Quamotion.Malaga.*.nupkg'
publishFeedCredentials: 'NuGet'
nuGetFeedType: external
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: Publish NuGet package