forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
189 lines (158 loc) · 5.7 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
pr:
- master
trigger:
- master
variables:
- group: fabric-variables
- template: .devops/templates/variables.yml
parameters:
pathPrefix: SourceVersion
pool: 'Self Host Ubuntu'
jobs:
- job: BuildTestLint
workspace:
clean: all
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: |
yarn checkchange
displayName: check change
## manually call this since lage is now used and it calls lint per package, not per repo
- script: |
yarn prelint
yarn prettier $(targetBranch) --check
displayName: do syncpack and lint-files checks
## Danger.js checks for Fluent UI N*
- 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)
## only do scoped builds with PRs
- script: |
yarn buildci --no-cache --since $(targetBranch)
displayName: build, test, lint (pr, scoped)
condition: ne(variables['Build.SourceBranch'], 'refs/heads/master')
env:
BACKFILL_CACHE_PROVIDER: $(backfillProvider)
BACKFILL_CACHE_PROVIDER_OPTIONS: $(backfillOptions)
## duplicated build step, but without --since flag for master CI builds
- script: |
yarn buildci --no-cache
displayName: build, test, lint (master)
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
env:
BACKFILL_CACHE_PROVIDER: $(backfillProvider)
BACKFILL_CACHE_PROVIDER_OPTIONS: $(backfillOptions)
- template: .devops/templates/cleanup.yml
- job: Deploy
workspace:
clean: all
variables:
- template: .devops/templates/variables.yml
steps:
- template: .devops/templates/tools.yml
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
## only do scoped bundle with PRs
- script: |
yarn bundle --no-cache --since $(targetBranch)
displayName: bundle (pr, scoped)
condition: ne(variables['Build.SourceBranch'], 'refs/heads/master')
env:
BACKFILL_CACHE_PROVIDER: $(backfillProvider)
BACKFILL_CACHE_PROVIDER_OPTIONS: $(backfillOptions)
## duplicated for master CI builds
- script: |
yarn bundle --no-cache
displayName: bundle (master)
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
env:
BACKFILL_CACHE_PROVIDER: $(backfillProvider)
BACKFILL_CACHE_PROVIDER_OPTIONS: $(backfillOptions)
## 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
- publish: $(Build.ArtifactStagingDirectory)
artifact: Build-PR-$(Build.BuildNumber)
- task: AzureUpload@2
displayName: Upload PR deploy site
inputs:
azureSubscription: $(azureSubscription)
BlobPrefix: $(deployBasePath)
ContainerName: '$web'
SourcePath: 'apps/pr-deploy-site/dist'
storage: fabricweb
- 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'
githubTargetLink: 'http://fabricweb.z5.web.core.windows.net/pr-deploy-site/$(Build.SourceBranch)/'
- task: AzureUpload@2
displayName: Upload demo images (master)
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
inputs:
azureSubscription: $(azureSubscription)
BlobPrefix: 'assets'
CacheControl: 'public, max-age=600000'
ContainerName: 'fabric-website' # this container has a CDN
SourcePath: 'packages/fluentui/docs/src/public'
storage: fabricweb
- template: .devops/templates/cleanup.yml
- job: ScreenerFluent
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
- task: AzureUpload@2
displayName: Upload N* doc site
inputs:
azureSubscription: $(azureSubscription)
BlobPrefix: '$(deployBasePath)/react-northstar'
CacheControl: 'public, max-age=600000'
ContainerName: '$web'
SourcePath: 'packages/fluentui/docs/dist'
storage: fabricweb
- script: yarn workspace @fluentui/docs vr:test
displayName: start FUI N* VR Test
env:
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 lage screener --to vr-tests --debug --verbose --no-cache
displayName: run VR Test
env:
SCREENER_API_KEY: $(screener.key)
BACKFILL_CACHE_PROVIDER: $(backfillProvider)
BACKFILL_CACHE_PROVIDER_OPTIONS: $(backfillOptions)
- template: .devops/templates/cleanup.yml