-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
73 lines (62 loc) · 2.05 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
trigger:
- publish
pool:
vmImage: 'ubuntu-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
shouldPublish: $[eq(variables['Build.SourceBranch'], 'refs/heads/publish')]
steps:
- task: UseDotNet@2
displayName: Use .NET (global.json)
inputs:
packageType: 'sdk'
useGlobalJson: true
- task: DotNetCoreCLI@2
displayName: Pack https
condition: eq(variables.shouldPublish, true)
inputs:
command: pack
publishWebProjects: false
packagesToPack: '**/https.csproj'
configuration: $(buildConfiguration)
packDirectory: $(build.ArtifactStagingDirectory)
versioningScheme: off
- task: DotNetCoreCLI@2
displayName: Pack https
condition: eq(variables.shouldPublish, false)
inputs:
command: pack
publishWebProjects: false
packagesToPack: '**/https.csproj'
configuration: $(buildConfiguration)
packDirectory: $(build.ArtifactStagingDirectory)
versioningScheme: byPrereleaseNumber
majorVersion: 0
minorVersion: 2
patchVersion: 0
- script: |
dotnet dev-certs https
displayName: Setup Tests
- task: DotNetCoreCLI@2
displayName: Test https
inputs:
command: test
projects: '**/https.Tests.csproj'
arguments: '--configuration $(buildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura -- xunit.parallelizeAssembly=true xunit.parallelizeTestCollections=true'
- script: |
dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools
./tools/reportgenerator -reports:$(Build.SourcesDirectory)/tests/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage -reporttypes:Cobertura
displayName: Generate Code Coverage Report
- task: PublishCodeCoverageResults@1
displayName: Publish Code Coverage Report
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/Cobertura.xml'
- task: PublishBuildArtifacts@1
displayName: Upload Artifacts
inputs:
PathtoPublish: '$(build.ArtifactStagingDirectory)'
ArtifactName: 'https'
Parallel: true