-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
66 lines (63 loc) · 2.13 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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
stages:
- stage: Build
displayName: Build Package
jobs:
- job: Build
displayName: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '3.1.x'
- task: DotNetCoreCLI@2
inputs:
command: 'test'
projects: '**/EngineTests.csproj'
arguments: '--collect:"XPlat Code Coverage"'
testRunTitle: 'Platform Unit tests'
- task: DotNetCoreCLI@2
inputs:
command: 'build'
projects: '**/Engine.csproj'
- task: CopyFiles@2
inputs:
SourceFolder: '$(Agent.TempDirectory)'
Contents: '**/coverage.cobertura.xml'
TargetFolder: '$(Build.SourcesDirectory)/codeCoverage'
CleanTargetFolder: true
OverWrite: true
flattenFolders: true
- script: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:"$(Build.SourcesDirectory)/codeCoverage/coverage.cobertura.xml" -targetdir:"$(Build.SourcesDirectory)/CodeCoverage" -reporttypes:"HtmlInline_AzurePipelines"
displayName: Create Code coverage report
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
summaryFileLocation: '$(Build.SourcesDirectory)/codeCoverage/coverage.cobertura.xml'
reportDirectory: '$(Build.SourcesDirectory)/CodeCoverage'
failIfCoverageEmpty: true
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
packagesToPack: '**/Engine.csproj'
versioningScheme: 'byPrereleaseNumber'
majorVersion: '0'
minorVersion: '2'
patchVersion: '0'
- task: PublishBuildArtifacts@1
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'package'
publishLocation: 'Container'