forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
235 lines (187 loc) · 6.31 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
pr:
- master
- website-content
trigger:
- master
variables:
- group: fabric-variables
pool: 'Self Host Ubuntu'
jobs:
- job: Build
steps:
- template: azure-pipelines.tools.yml
- template: azure-pipelines.cache.yml
- script: |
yarn
displayName: yarn
- script: |
yarn checkchange
displayName: check change
- script: |
yarn build
displayName: build
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: $(Build.Repository.LocalPath)
# Include root folder so archive can just be extracted into $(Pipeline.Workspace)
includeRootFolder: true
archiveType: 'tar'
tarCompression: 'gz'
archiveFile: $(Build.ArtifactStagingDirectory)/build.tar.gz
replaceExistingArchive: true
- publish: $(Build.ArtifactStagingDirectory)
artifact: Build-PR-$(Build.BuildNumber)
- script: |
az --version
az extension add -n azure-devops
echo $(buildQueuePat) | az devops login --organization https://dev.azure.com/uifabric
az devops configure --defaults organization=https://dev.azure.com/uifabric project="fabricpublic" --use-git-aliases true
env:
AZURE_DEVOPS_EXT_PAT: $(buildQueuePat)
displayName: Set up Azure CLI with DevOps
- script: |
az pipelines build queue --verbose --org https://dev.azure.com/uifabric -p fabricpublic --definition-name "Fluent UI React - Perf-Test" --branch $(Build.SourceBranch) --variables artifact=Build-PR-$(Build.BuildNumber) buildId=$(Build.BuildId) buildReason=$(Build.Reason)
env:
AZURE_DEVOPS_EXT_PAT: $(buildQueuePat)
displayName: Trigger Perf-Test and Screener jobs
- task: DeleteFiles@1
inputs:
SourceFolder: $(Build.SourcesDirectory)
Contents: '**/*'
condition: always()
- job: Validate
dependsOn: Build
pool: 'Self Host Ubuntu'
steps:
# No need for checkout since we're using build artifacts.
- checkout: none
- template: azure-pipelines.cache.yml
- template: azure-pipelines.artifacts.yml
parameters:
artifact: Build-PR-$(Build.BuildNumber)
buildId: $(Build.BuildId)
- template: azure-pipelines.tools.yml
- script: |
yarn test
displayName: test
- script: |
yarn lint
displayName: lint
- script: |
yarn check-for-changed-files
displayName: check for changed files
- task: DeleteFiles@1
inputs:
SourceFolder: $(Build.SourcesDirectory)
Contents: '**/*'
condition: always()
- job: ValidateFluent
dependsOn: Build
steps:
# No need for checkout since we're using build artifacts.
- checkout: none
- template: azure-pipelines.cache.yml
- template: azure-pipelines.artifacts.yml
parameters:
artifact: Build-PR-$(Build.BuildNumber)
buildId: $(Build.BuildId)
- template: azure-pipelines.tools.yml
- script: |
if [ $BUILD_REASON == "PullRequest" ]; then
yarn danger ci
else
echo "Skipping Danger JS because BUILD_REASON ${BUILD_REASON} != PullRequest"
fi
displayName: danger
env:
DANGER_GITHUB_API_TOKEN: $(DANGER_GITHUB_API_TOKEN)
- script: |
yarn test:fluentui:e2e
displayName: E2E Tests
- script: |
yarn test:fluentui:projects
displayName: Project Tests
- script: |
yarn test:fluentui:circulars
displayName: Circular Dependencies Tests
- script: |
yarn check-for-changed-files
displayName: check for changed files
- task: DeleteFiles@1
inputs:
SourceFolder: $(Build.SourcesDirectory)
Contents: '**/*'
condition: always()
- job: Deploy
dependsOn: Build
variables:
PR_DEPLOY: 1
steps:
- template: azure-pipelines.cache.yml
- template: azure-pipelines.artifacts.yml
parameters:
artifact: Build-PR-$(Build.BuildNumber)
buildId: $(Build.BuildId)
- template: azure-pipelines.tools.yml
- script: |
NODE_ENV=production yarn build:fluentui:docs
yarn bundle
displayName: bundle
- task: AzureUpload@1
displayName: Upload PR deploy site
inputs:
SourcePath: 'apps/pr-deploy-site/dist'
azureSubscription: 'UI Fabric (bac044cf-49e1-4843-8dda-1ce9662606c8)'
storage: fabricweb
ContainerName: '$web'
BlobPrefix: 'pr-deploy-site/$(Build.SourceBranch)'
- task: DeleteFiles@1
inputs:
SourceFolder: $(Build.SourcesDirectory)
Contents: '**/*'
condition: always()
- job: ScreenerFluent
steps:
- script: |
yarn
displayName: yarn
- template: azure-pipelines.cache.yml
- template: azure-pipelines.tools.yml
- script: |
git config --global user.email "fabrictactical@microsoft.com"
git config --global user.name "Fabric Tactical"
yarn test:fluentui:visual
displayName: run FUI VR Test
env:
SCREENER_API_KEY: $(screener.key)
- task: DeleteFiles@1
inputs:
SourceFolder: $(Build.SourcesDirectory)
Contents: '**/*'
condition: always()
- job: Screener
dependsOn: Build
# keeping this at microsoft hosted because this doesn't require builds
pool:
vmImage: 'Ubuntu 18.04'
steps:
# No need for checkout since we're using build artifacts.
- checkout: none
- template: azure-pipelines.cache.yml
- template: azure-pipelines.artifacts.yml
parameters:
artifact: Build-PR-$(Build.BuildNumber)
buildId: $(Build.BuildId)
- template: azure-pipelines.tools.yml
- script: |
git config --global user.email "fabrictactical@microsoft.com"
git config --global user.name "Fabric Tactical"
yarn vrtest -- --debug
displayName: run VR Test
env:
SCREENER_API_KEY: $(screener.key)
- task: DeleteFiles@1
inputs:
SourceFolder: $(Build.SourcesDirectory)
Contents: '**/*'
condition: always()