-
Notifications
You must be signed in to change notification settings - Fork 260
/
azure-pipelines.yml
199 lines (182 loc) · 6.45 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# Branch(es) that trigger(s) build(s) on PR
pr:
branches:
include:
- main
- rel/*
paths:
exclude:
- .github/*
- .devcontainer/*
- docs/*
- .markdownlint.json
- .markdownlintignore
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- README.md
- SECURITY.md
- src/**/*.xlf
parameters:
# This option should be used with caution. This is useful for unblocking circular deps issue with testanywhere
- name: SkipTests
displayName: "Skip tests"
type: boolean
default: False
variables:
# Cannot use key:value syntax in root defined variables
- name: _TeamName
value: MSTest
- name: _RunAsInternal
value: False
- name: _RunAsPublic
value: True
stages:
- stage: build
displayName: Build
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: true
testResultsFormat: 'vstest'
enablePublishBuildAssets: true
enablePublishUsingPipelines: true
enableTelemetry: true
enableSourceBuild: true
jobs:
- job: Windows
timeoutInMinutes: 90
pool:
name: NetCore-Public
demands: ImageOverride -equals windows.vs2022preview.amd64.open
strategy:
matrix:
Release:
_BuildConfig: Release
Debug:
_BuildConfig: Debug
steps:
- task: PowerShell@2
displayName: 'Install Windows SDK'
inputs:
targetType: filePath
filePath: './eng/install-windows-sdk.ps1'
failOnStderr: true
showWarnings: true
- task: PowerShell@2
displayName: 'Install procdump'
inputs:
targetType: filePath
filePath: ./eng/install-procdump.ps1
failOnStderr: true
showWarnings: true
- task: PowerShell@2
displayName: 'Install Access Database Engine'
inputs:
targetType: filePath
filePath: ./eng/install-access-database-engine.ps1
failOnStderr: true
showWarnings: true
- script: eng\common\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
/p:Test=false
/p:FastAcceptanceTest=true
name: Build
displayName: Build
- ${{ if eq(parameters.SkipTests, False) }}:
# -ci is allowing to import some environment variables and some required configurations
# -nobl avoids overwriting build binlog with binlog from tests
- script: Test.cmd
-configuration $(_BuildConfig)
-ci
-nobl
name: Test
displayName: Test
# This step is only helpful for diagnosing some issues with vstest/test host that would not appear
# through the console or trx
- task: PublishBuildArtifacts@1
displayName: 'Publish Test Results folders'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
ArtifactName: TestResults_Windows_$(_BuildConfig)
condition: failed()
# Upload code coverage to codecov.io
- script: $(Build.SourcesDirectory)/.dotnet/dotnet msbuild -restore
eng/CodeCoverage.proj
/p:Configuration=$(_BuildConfig)
/bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\CodeCoverage.binlog
displayName: Upload coverage to codecov.io
condition: and(succeeded(), eq(variables._BuildConfig, 'Debug'))
- job: Linux
timeoutInMinutes: 90
pool:
name: NetCore-Public
demands: ImageOverride -equals build.ubuntu.2004.amd64.open
strategy:
matrix:
Release:
_BuildConfig: Release
Debug:
_BuildConfig: Debug
steps:
- script: eng/common/cibuild.sh
-configuration $(_BuildConfig)
-prepareMachine
/p:Test=false
/p:NonWindowsBuild=true
/p:FastAcceptanceTest=true
displayName: Build
- ${{ if eq(parameters.SkipTests, False) }}:
# --ci is allowing to import some environment variables and some required configurations
# --nobl avoids overwriting build binlog with binlog from tests
- script: |
chmod +x ./test.sh
./test.sh --configuration $(_BuildConfig) --ci --test --integrationTest --nobl
name: Test
displayName: Tests
# This step is only helpful for diagnosing some issues with vstest/test host that would not appear
# through the console or trx
- task: PublishBuildArtifacts@1
displayName: 'Publish Test Results folders'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
ArtifactName: TestResults_Linux_$(_BuildConfig)
condition: failed()
- job: MacOS
timeoutInMinutes: 90
pool:
name: Azure Pipelines
vmImage: macos-latest
os: macOS
strategy:
matrix:
Release:
_BuildConfig: Release
Debug:
_BuildConfig: Debug
steps:
- script: eng/common/cibuild.sh
-configuration $(_BuildConfig)
-prepareMachine
/p:Test=false
/p:NonWindowsBuild=true
/p:FastAcceptanceTest=true
displayName: Build
- ${{ if eq(parameters.SkipTests, False) }}:
# --ci is allowing to import some environment variables and some required configurations
# --nobl avoids overwriting build binlog with binlog from tests
- script: |
chmod +x ./test.sh
./test.sh --configuration $(_BuildConfig) --ci --test --integrationTest --nobl
name: Test
displayName: Tests
# This step is only helpful for diagnosing some issues with vstest/test host that would not appear
# through the console or trx
- task: PublishBuildArtifacts@1
displayName: 'Publish Test Results folders'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
ArtifactName: TestResults_MacOs_$(_BuildConfig)
condition: failed()