forked from microsoftgraph/group-membership-management
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-services.yml
89 lines (76 loc) · 2.99 KB
/
build-services.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
parameters:
- name: repoToCheckout
type: string
- name: checkoutPath
type: string
stages:
- stage: BuildCommon
jobs:
- job: GMMBuildAndRelease
strategy:
maxParallel: 2
matrix:
debug:
BuildConfiguration: debug
release:
BuildConfiguration: release
steps:
- ${{ if ne(parameters.repoToCheckout, '') }}:
- checkout: ${{ parameters.repoToCheckout }}
path: ${{ parameters.checkoutPath }}
- task: UseDotNet@2
inputs:
packageType: 'sdk'
useGlobalJson: true
workingDirectory: 'Service\GroupMembershipManagement'
- task: DeleteFiles@1
displayName: "Clean up development local settings files"
inputs:
SourceFolder: 'Service\GroupMembershipManagement'
Contents: '**/local.settings.json'
- task: DotNetCoreCLI@2
displayName: dotnet build
inputs:
command: build
workingDirectory: 'Service\GroupMembershipManagement'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
workingDirectory: 'Service\GroupMembershipManagement'
# see https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/Examples/MSBuild/MergeWith/HowTo.md for how to merge all the test output into one report
arguments: '--configuration $(BuildConfiguration) /p:CollectCoverage=true /p:MergeWith="$(Build.SourcesDirectory)/Coverage/coverage.json" /p:CoverletOutputFormat="cobertura" /p:CoverletOutput="$(Build.SourcesDirectory)/Coverage/" -m:1'
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'debug'))
- task: PublishCodeCoverageResults@1
displayName: 'collect code coverage'
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: $(Build.SourcesDirectory)\Coverage\coverage.cobertura.xml
failIfCoverageEmpty: false
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'debug'))
- task: mspremier.BuildQualityChecks.QualityChecks-task.BuildQualityChecks@8
displayName: 'check build quality'
inputs:
checkCoverage: true
coverageFailOption: fixed
coverageType: lines
coverageThreshold: 10
coverageVariance: 0
allowCoverageVariance: false
condition: and(succeeded(), eq(variables['BuildConfiguration'], 'debug'))
- task: CopyFiles@2
displayName: 'copy arm templates'
inputs:
SourceFolder: Infrastructure
TargetFolder: '$(build.artifactstagingdirectory)/Infrastructure'
- task: CopyFiles@2
displayName: 'copy release management scripts'
inputs:
SourceFolder: Scripts
TargetFolder: '$(build.artifactstagingdirectory)/Scripts'
- task: PublishBuildArtifacts@1
displayName: 'publish artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
ArtifactName: '$(Build.BuildNumber)_$(BuildConfiguration)'