forked from NuKeeperDotNet/NuKeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.azure-build.yml
48 lines (42 loc) · 1.54 KB
/
.azure-build.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
queue:
name: Hosted VS2017
variables:
buildConfiguration: Release
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
steps:
- task: DotNetCoreInstaller@1
displayName: 'Use .NET Core sdk 2.2.x'
inputs:
version: 2.2.x
- bash: echo NugetVersion is $NugetVersion; export NugetVersion
displayName: 'export NugetVersion into env vars'
env:
NugetVersion: $(NugetVersion)
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: build
projects: 'NuKeeper.sln'
arguments: '--configuration $(BuildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
projects: 'NuKeeper.sln'
arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura'
nobuild: true
- script: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:$(Build.SourcesDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage -reporttypes:HtmlInline_AzurePipelines;Cobertura
displayName: Create Code coverage report
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/Cobertura.xml'
reportDirectory: '$(Build.SourcesDirectory)/CodeCoverage'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop for master'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)'
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))