forked from NuKeeperDotNet/NuKeeper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.azure-build.yml
60 lines (52 loc) · 1.8 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
49
50
51
52
53
54
55
56
57
58
59
60
strategy:
matrix:
Linux:
imageName: 'ubuntu-latest'
Windows:
imageName: 'windows-2019'
Mac:
imageName: 'macOS-10.14'
pool:
vmImage: $(imageName)
variables:
buildConfiguration: Release
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
steps:
- task: DotNetCoreInstaller@1
displayName: 'Use .NET Core sdk 5.0.x'
inputs:
version: 5.0.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: '--collect:"XPlat Code Coverage" --configuration $(BuildConfiguration)'
nobuild: true
- script: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:$(Agent.TempDirectory)/**/coverage.cobertura.xml -targetdir:$(Build.SourcesDirectory)/CodeCoverage -reporttypes:HtmlInline_AzurePipelines;Cobertura
displayName: Create Code coverage report
condition: eq(variables['Agent.OS'], 'Windows_NT')
- task: PublishCodeCoverageResults@1
displayName: 'Publish code coverage'
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(Build.SourcesDirectory)/CodeCoverage/Cobertura.xml'
reportDirectory: '$(Build.SourcesDirectory)/CodeCoverage'
condition: eq(variables['Agent.OS'], 'Windows_NT')
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop for master'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)'
condition: and(and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')), eq(variables['Agent.OS'], 'Windows_NT'))