This repository has been archived by the owner on Jul 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
azure-pipelines.yml
132 lines (117 loc) · 3.54 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: merq
trigger:
batch: false
branches:
include:
- master
- dev/*
- feature/*
- rel/*
paths:
exclude:
- docs
- icon
variables:
- group: Xamarin Release
- group: Xamarin-Secrets
- name: Configuration
value: Release
- name: DotNetVersion
value: 3.1.x
- name: PackageOutputPath
value: $(Build.ArtifactStagingDirectory)/package
- name: System.Debug
value: true
resources:
repositories:
- repository: templates
type: github
name: xamarin/yaml-templates
ref: refs/heads/master
endpoint: xamarin
stages:
- stage: Windows
jobs:
- job: Build
pool: VSEng-MicroBuildVS2019
steps:
- checkout: self
clean: true
submodules: recursive
- task: UseDotNet@2
inputs:
version: $(DotNetVersion)
performMultiLevelLookup: true
- script: 'dotnet tool update -g dotnet-format && dotnet format -f $(Build.SourcesDirectory)\src --dry-run --check -v:diag'
displayName: Check .editorconfig compliance
- template: dump-environment.yml@templates
- task: MSBuild@1
displayName: Build
inputs:
solution: src\Merq.sln
msbuildArguments: '-r -bl:$(Build.ArtifactStagingDirectory)/logs/build.binlog'
- task: VSTest@2
displayName: 'Test'
timeoutInMinutes: 5
inputs:
testAssemblyVer2: |
**\*Tests.dll
!**\*IntegrationTests.dll
!**\*TestAdapter.dll
!**\obj\**
codeCoverageEnabled: true
runInParallel: false
rerunFailedTests: true
rerunMaxAttempts: 5
- task: PublishBuildArtifacts@1
displayName: 'Logs'
condition: always()
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/logs'
ArtifactName: logs
- task: PublishBuildArtifacts@1
displayName: 'Artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/package'
ArtifactName: package
- task: PublishBuildArtifacts@1
displayName: 'Symbols'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/artifacts'
ArtifactName: symbols
- stage: Upload
jobs:
- job: Upload
pool: VSEng-MicroBuildVS2019
steps:
- checkout: self
- task: UseDotNet@2
inputs:
packageType: runtime
version: $(DotNetVersion)
performMultiLevelLookup: true
- script: 'dotnet tool update -g --version 7.0.0 PowerShell >nul || dotnet tool list -g'
displayName: UsePowerShell
- template: fix-source-version/v2.yml@templates
# This is only needed while we teach the build-tools tasks how to receive overriden variables.
- script: git reset --hard $(GitHub.Commit)
displayName: Align checkout with GitHub.Commit
condition: ne(variables['GitHub.Commit'], variables['Build.SourceVersion'])
- task: DownloadBuildArtifacts@0
inputs:
artifactName: package
- template: dump-environment.yml@templates
- template: upload-to-storage/win/v1.yml@templates
parameters:
ArtifactsDirectory: '$(Build.ArtifactStagingDirectory)/package'
Azure.ContainerName: 'xvs-merq'
GitHub.Context: 'artifacts'
- task: NuGetCommand@2
displayName: Push Packages
continueOnError: true
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['PushPackages'], 'true')))
inputs:
command: push
packagesToPush: $(Build.ArtifactStagingDirectory)/package/*.nupkg
nuGetFeedType: external
publishFeedCredentials: 'xamarin-impl public feed'