forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.yml
117 lines (94 loc) · 3.48 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
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: |
# @fluentui/api-docs is used within apps/public-docsite-resources/just.config.ts thus it needs to be build in advance
yarn workspace @fluentui/api-docs build
yarn tsc -p ./tsconfig.json
displayName: Type-check just.config.ts files
- 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: |
DANGER_DISABLE_TRANSPILATION="true" 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