forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
171 lines (138 loc) · 4.84 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
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 checkchange
displayName: verify change files
- script: |
yarn nx workspace-lint
displayName: nx:workspace-lint
- 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 --no-cache $(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 --no-cache $(sinceArg)
displayName: bundle
- script: |
yarn lage build-storybook --no-cache --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)/
# only run e2e tests when converged storybook is published by scoping to the converged suite package
- script: |
yarn e2e $(sinceArg) --scope @fluentui/react-components
displayName: Cypress E2E tests
- template: .devops/templates/cleanup.yml
- job: ScreenerNorthstar
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 FUI N* VR Test
env:
SCREENER_ENDPOINT: $(screenerApiUri)
SCREENER_PROXY_ENDPOINT: $(screenerProxyUri)
SCREENER_API_KEY: $(screener.key)
- template: .devops/templates/cleanup.yml
- job: Screener
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
# 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: run VR Test
env:
SCREENER_API_KEY: $(screener.key)
- template: .devops/templates/cleanup.yml