forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
222 lines (182 loc) · 6.64 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
pr:
- master
# There's a separate pipeline for CI which also uses this file, but with a trigger override in the UI
# https://dev.azure.com/uifabric/fabricpublic/_apps/hub/ms.vss-ciworkflow.build-ci-hub?_a=edit-build-definition&id=164&view=Tab_Triggers
trigger: none
variables:
- ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/')) }}:
- name: sinceArg
value: --since $(targetBranch)
- group: fabric-variables
- template: .devops/templates/variables.yml
pool: '1ES-Host-Ubuntu'
jobs:
- job: BuildTestLint
workspace:
clean: all
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn (install packages)
- script: |
yarn nx workspace-lint
yarn nx run @fluentui/nx-workspace-tools:check-graph
displayName: NX workspace lint
- script: |
yarn check:installed-dependencies-versions
displayName: 'check packages: installed dependencies versions'
- script: |
if [[ -n "$(targetBranch)" ]]; then
yarn format --since $(targetBranch) --check
else
yarn format --all --check
fi
displayName: check formatting
## Danger.js checks for Fluent UI N*
- script: |
yarn danger ci
displayName: danger
condition: eq(variables.isPR, true)
env:
DANGER_GITHUB_API_TOKEN: $(DANGER_GITHUB_API_TOKEN)
- script: |
yarn buildci $(sinceArg)
displayName: build, test, lint
- template: .devops/templates/cleanup.yml
- job: DeployE2E
displayName: Deploy and E2E
workspace:
clean: all
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
# this also builds FUI N* docs if appropriate
- script: |
yarn bundle $(sinceArg)
displayName: bundle
- script: |
yarn lage build-storybook --verbose $(sinceArg)
displayName: build Storybooks
## This runs regardless of scope, the app will adapt to the scope as well
- script: |
yarn workspace @fluentui/pr-deploy-site generate:site
displayName: generate PR Deploy Site
- task: AzureUpload@2
displayName: Upload PR deploy site
inputs:
azureSubscription: $(azureSubscription)
BlobPrefix: $(deployBasePath)
ContainerName: '$web'
SourcePath: 'apps/pr-deploy-site/dist'
storage: $(azureStorage)
- task: GithubPRStatus@0
displayName: 'Update PR deploy site github status'
inputs:
githubOwner: microsoft
githubRepo: fluentui
githubContext: 'Pull request demo site'
githubDescription: 'Click "Details" to go to the deployed demo site for this pull request'
# This MUST have a trailing slash, or the links to PR deploy site assets won't work
githubTargetLink: $(deployUrl)/
- script: |
yarn e2e $(sinceArg)
displayName: Cypress E2E tests
- template: .devops/templates/cleanup.yml
- job: ScreenerNorthstar
displayName: Screener @fluentui/react-northstar
workspace:
clean: all
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: |
yarn workspace @fluentui/docs vr:build
displayName: build FUI N* VR Test
env:
SCREENER_BUILD: 1
- task: AzureUpload@2
displayName: Upload N* VR test site
inputs:
azureSubscription: $(azureSubscription)
BlobPrefix: $(deployBasePath)/react-northstar-screener
CacheControl: 'public, max-age=600000'
ContainerName: '$web'
SourcePath: 'packages/fluentui/docs/dist'
storage: $(azureStorage)
- script: yarn workspace @fluentui/docs vr:test
displayName: Start @fluentui/react-northstar VR Test
env:
SCREENER_ENDPOINT: $(screenerApiUri)
SCREENER_PROXY_ENDPOINT: $(screenerProxyUri)
SCREENER_API_KEY: $(screener.key)
- template: .devops/templates/cleanup.yml
- job: Screener
displayName: Screener @fluentui/react
workspace:
clean: all
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: |
yarn workspace @fluentui/vr-tests screener:build
displayName: build vr-tests storybook
- task: AzureUpload@2
displayName: Upload @fluentui/react VR test site
inputs:
azureSubscription: $(azureSubscription)
BlobPrefix: $(deployBasePath)/react-screener
CacheControl: 'public, max-age=600000'
ContainerName: '$web'
SourcePath: 'apps/vr-tests/dist/storybook'
storage: $(azureStorage)
# Don't use lage here because it eats long output for reasons that are hard to debug
- script: |
yarn workspace @fluentui/vr-tests screener
displayName: Start @fluentui/react VR Test
env:
SCREENER_ENDPOINT: $(screenerApiUri)
SCREENER_PROXY_ENDPOINT: $(screenerProxyUri)
SCREENER_API_KEY: $(screener.key)
- template: .devops/templates/cleanup.yml
- job: ScreenerVNext
displayName: Screener @fluentui/react-components
workspace:
clean: all
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: |
yarn workspace @fluentui/vr-tests-react-components screener:build
displayName: build vr-tests-react-components storybook
- task: AzureUpload@2
displayName: Upload @fluentui/react-components VR test site
inputs:
azureSubscription: $(azureSubscription)
BlobPrefix: $(deployBasePath)/react-components-screener
CacheControl: 'public, max-age=600000'
ContainerName: '$web'
SourcePath: 'apps/vr-tests-react-components/dist/storybook'
storage: $(azureStorage)
# Don't use lage here because it eats long output for reasons that are hard to debug
- script: |
yarn workspace @fluentui/vr-tests-react-components screener
displayName: Start @fluentui/react-components VR Test
env:
SCREENER_ENDPOINT: $(screenerApiUri)
SCREENER_PROXY_ENDPOINT: $(screenerProxyUri)
SCREENER_API_KEY: $(screener.key)
- template: .devops/templates/cleanup.yml