/
azure-pipelines.yml
270 lines (242 loc) · 10.3 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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
variables:
- group: InfoSec-SecurityResults
- name: products
value: 6eff390d-80c0-4456-81b6-6abafa71e768
- name: tags
value: production
trigger:
branches:
include:
- 'main'
- 'release/*'
resources:
repositories:
- repository: OfficePipelineTemplates
type: git
name: 1ESPipelineTemplates/OfficePipelineTemplates
ref: refs/tags/release
- repository: AppHostingSdk
type: git
name: ISS/metaos-hub-sdk
ref: refs/heads/main
- repository: AndroidAppHostingSdk
type: git
name: ISS/metaos-hub-sdk-android
- repository: IOSAppHostingSdk
type: git
name: ISS/metaos-hub-sdk-ios
extends:
template: v1/Office.Official.PipelineTemplate.yml@OfficePipelineTemplates
parameters:
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-2022
os: windows
sdl:
eslint:
configuration: 'required'
parser: '@typescript-eslint/parser'
parserOptions: 'ecmaFeatures:{jsx:true}\necmaVersion:12\nsourceType:module\nproject:$(Build.SourcesDirectory)/tsconfig.common.json'
enableExclusions: true
exclusionPatterns": "*.d.ts\n*.spec.js\n*.spec.jsx\n*.spec.ts\n*.spec.tsx\n*.test.ts\n*.test.tsx"
customEnvironments: true
environmentsBrowser: true
environmentsNode: true
environmentsCommonJs: true
environmentsSharedNodeBrowser: false
environmentsEs6: false
environmentsEs2017: false
environmentsEs2020: true
environmentsJest: false
sourceRepositoriesToScan:
include:
- repository: AppHostingSdk
- repository: AndroidAppHostingSdk
- repository: IOSAppHostingSdk
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: __default
jobs:
- job: Security
displayName: 'Security Tasks'
steps:
- template: tools/yaml-templates/security.yml@self
- job: Build
displayName: 'Build Test Publish'
steps:
- template: tools/yaml-templates/build-test-publish.yml@self
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish bundle analysis'
condition: and( in(variables['Agent.JobStatus'], 'Succeeded', 'SucceededWithIssues'), eq(variables['Build.Reason'], 'PullRequest'), eq(variables['System.PullRequest.TargetBranch'], 'main'))
targetPath: './common/temp/bundleAnalysis'
artifactName: '$(bundleArtifactName)'
- output: pipelineArtifact
displayName: 'Publish Test app artifacts'
targetPath: '$(Build.ArtifactStagingDirectory)\teams-test-app\$(Build.BuildId).zip'
artifactName: 'teams-test-app'
sbomBuildDropPath: '$(Build.ArtifactStagingDirectory)\teams-test-app'
sbomPackageName: 'teamstestappArtifact'
- output: pipelineArtifact
displayName: 'Publish CDN feed to build Artifacts'
targetPath: '$(Build.ArtifactStagingDirectory)\CDNFeed'
artifactName: 'CDNFeed'
- output: pipelineArtifact
displayName: 'Publish validDomains to Build Artifacts'
targetPath: '$(Build.ArtifactStagingDirectory)\validDomains'
artifactName: 'validDomains'
- output: pipelineArtifact
displayName: 'Publish NPM feed to Build Artifacts'
targetPath: '$(Build.ArtifactStagingDirectory)\NPMFeed'
artifactName: 'NPMFeed'
- output: pipelineArtifact
displayName: 'Publish Powershell Scripts to Build Artifacts'
targetPath: '$(Build.ArtifactStagingDirectory)\scripts'
artifactName: 'scripts'
- job: E2ETest1
displayName: 'E2E Test - Perf'
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: 'ubuntu-latest'
os: linux
steps:
- template: tools/yaml-templates/build-app-host.yml@self
parameters:
appHostGitPath: AppHostingSdk
- task: Bash@3
displayName: 'Run E2E Perf tests'
condition: succeeded()
inputs:
targetType: inline
script: 'node tools/cli/runAppsWithE2ETests.js --appUrl=https://localhost:4002 --reportFileName=e2e-tests-report-perf --envType=perf'
workingDirectory: '$(AppHostingSdkProjectDirectory)'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/e2e-tests-report*.xml'
testRunTitle: 'E2E Tests - Perf'
mergeTestResults: true
condition: succeededOrFailed()
- job: E2ETest2
displayName: 'E2E Test - Default'
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: 'ubuntu-2004'
os: linux
steps:
- template: tools/yaml-templates/build-app-host.yml@self
parameters:
appHostGitPath: AppHostingSdk
- bash: 'node tools/cli/runAppsWithE2ETests.js --useDataFromLocal=true'
displayName: 'Run E2E integration tests'
condition: succeeded()
workingDirectory: '$(AppHostingSdkProjectDirectory)'
- task: CMDLine@2
displayName: 'Run tests for electron webview'
inputs:
script: |
pnpm exec xvfb-maybe playwright test
workingDirectory: '$(AppHostingSdkProjectDirectory)'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/e2e-tests-report*.xml'
testRunTitle: 'E2E Tests - Default'
mergeTestResults: true
condition: succeededOrFailed()
- job: E2ETest3
displayName: 'E2E Test - Local Tag'
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: 'ubuntu-latest'
os: linux
steps:
- template: tools/yaml-templates/build-app-host.yml@self
parameters:
appHostGitPath: AppHostingSdk
- task: CmdLine@2
displayName: 'Build Test App Local'
inputs:
script: |
pnpm build-test-app-local
workingDirectory: '$(ClientSdkProjectDirectory)'
- bash: 'node tools/cli/runAppsWithE2ETests.js --useDataFromLocal=true --reportFileName=e2e-tests-report-local-script-tag --envType=localScriptTag'
displayName: 'Run E2E integration tests with local script tag'
condition: succeeded()
workingDirectory: '$(AppHostingSdkProjectDirectory)'
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/e2e-tests-report*.xml'
testRunTitle: 'E2E Tests - Local Tag'
mergeTestResults: true
condition: succeededOrFailed()
- job: E2ETestCDN
displayName: 'E2E Test - CDN (only runs on release builds)'
# This test only runs after deployment from a release branch and the new CDN version has been deployed
# This check will run on the PR to merge the release branch back into main
condition: and(
eq(variables['Build.Reason'], 'PullRequest'),
startsWith(variables['System.PullRequest.SourceBranch'], 'release/'),
eq(variables['System.PullRequest.TargetBranch'], 'main')
)
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: 'ubuntu-latest'
os: linux
steps:
- template: tools/yaml-templates/build-app-host.yml@self
parameters:
appHostGitPath: AppHostingSdk
- task: CmdLine@2
displayName: 'Build Test App CDN'
inputs:
script: |
pnpm build-test-app-CDN
workingDirectory: '$(ClientSdkProjectDirectory)'
- bash: 'node tools/cli/runAppsWithE2ETests.js --useDataFromLocal=true --reportFileName=e2e-tests-report-cdn-script-tag --envType=cdnScriptTag'
displayName: 'Run E2E integration tests with local script tag on latest cdn bundles'
condition: succeeded()
workingDirectory: '$(AppHostingSdkProjectDirectory)'
enabled: true
- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/e2e-tests-report*.xml'
testRunTitle: 'E2E Tests - CDN'
mergeTestResults: true
condition: succeededOrFailed()
- job: E2ETestAndroid
displayName: 'E2E Test - Android'
pool:
name: Azure Pipelines
image: internal-macos12
os: macOS
steps:
- template: tools/yaml-templates/android-test.yml@self
parameters:
androidAppHostingSdkGitPath: AndroidAppHostingSdk
- job: E2ETestIOS
displayName: 'E2E Test - IOS - Plan A'
pool:
name: Azure Pipelines
image: internal-macos12
os: macOS
steps:
- template: tools/yaml-templates/ios-test.yml@self
parameters:
iOSAppHostingSdkGitPath: IOSAppHostingSdk
testPlan: iosE2ETestPlanA
- job: E2ETestIOS2
displayName: 'E2E Test - IOS - Plan B'
pool:
name: Azure Pipelines
image: internal-macos12
os: macOS
steps:
- template: tools/yaml-templates/ios-test.yml@self
parameters:
iOSAppHostingSdkGitPath: IOSAppHostingSdk
testPlan: iosE2ETestPlanB