forked from microsoft/accessibility-insights-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.yaml
175 lines (146 loc) · 6.43 KB
/
build.yaml
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
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# Note that this Azure DevOps pipeline is largely redundant with /.github/workflows/ci.yml, which
# is what we use instead for validation builds of pull requests. This CI build only runs against
# pushes to main, not PRs; it exists in tandem with the GitHub Actions CI build because it
# integrates better with our ADO-based release process.
trigger:
branches:
include:
- main
variables:
windowsImage: 'windows-2019'
macImage: 'macOS-11'
linuxImage: 'ubuntu-20.04'
Codeql.Enabled: true
jobs:
- job: 'unit_tests_and_lints'
pool:
vmImage: $(linuxImage)
steps:
- template: pipeline/install-node-prerequisites.yaml
- script: yarn lint:check:all
displayName: check lint errors
timeoutInMinutes: 5
- script: yarn format:check
displayName: check formatting errors
timeoutInMinutes: 5
- script: yarn copyright:check
displayName: check copyrightheaders
timeoutInMinutes: 1
- script: yarn scss:build
displayName: generate typings for scss files
timeoutInMinutes: 3
- script: yarn type:check
displayName: type check code
timeoutInMinutes: 3
- script: yarn null:check
displayName: check for strictNullChecks violations
timeoutInMinutes: 5
# We set maxWorkers to 2 since our CI VMs have 2 cores and by default Jest only uses 1.
# If this were to change in the future, the number here should change accordingly.
- script: yarn test --maxWorkers=2 --ci
displayName: run unit tests
timeoutInMinutes: 25
- task: PublishTestResults@2
inputs:
testResultsFiles: $(System.DefaultWorkingDirectory)/test-results/unit/junit.xml
testRunTitle: $(Agent.JobName)
condition: always()
displayName: publish test results
timeoutInMinutes: 3
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/test-results/unit/coverage/cobertura-coverage.xml
failIfCoverageEmpty: true
# We care most about the summary information; adding the detailed files doesn't give enough extra information
# to be worth the 1min it adds to the build.
# Consider re-enabling this once https://github.com/Microsoft/azure-pipelines-tasks/issues/4945 is resolved.
# reportDirectory: $(System.DefaultWorkingDirectory)/test-results/unit/coverage/lcov-report
displayName: publish code coverage
timeoutInMinutes: 5
- script: yarn publish-code-coverage -t $(CODECOV_TOKEN)
displayName: Publish code coverage to codecov
timeoutInMinutes: 3
- job: 'publish_build_drops'
pool:
vmImage: $(linuxImage)
steps:
- template: pipeline/install-node-prerequisites.yaml
- task: ComponentGovernanceComponentDetection@0
displayName: 'dependency detection (Component Governance)'
condition: and(succeeded(), eq(variables['GenerateReleaseNoticeFile'], 'true'))
inputs:
detectorsFilter: Yarn
ignoreDirectories: 'drop,dist,extension,node_modules'
verbosity: Normal
timeoutInMinutes: 5
- task: msospo.ospo-extension.8d7f9abb-6896-461d-9e25-4f74ed65ddb2.notice@0
displayName: 'generate NOTICE.html file'
condition: and(succeeded(), eq(variables['GenerateReleaseNoticeFile'], 'true'))
inputs:
outputfile: '$(System.DefaultWorkingDirectory)/src/NOTICE.html'
outputformat: html
timeoutInMinutes: 5
- script: yarn build:all
displayName: build:all
timeoutInMinutes: 10
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(System.DefaultWorkingDirectory)/drop'
artifactName: 'drop'
displayName: publish drop
timeoutInMinutes: 5
- job: 'e2e_report_linux'
pool:
vmImage: $(linuxImage)
steps:
- template: pipeline/install-node-prerequisites.yaml
- script: yarn build:package:report
displayName: build report package
timeoutInMinutes: 5
- script: yarn test:report:e2e --ci
displayName: run report package e2e tests
timeoutInMinutes: 5
- task: PublishTestResults@2
inputs:
testResultsFiles: $(System.DefaultWorkingDirectory)/packages/report-e2e-tests/test-results/unit/junit.xml
testRunTitle: $(Agent.JobName)
condition: always()
displayName: publish test results
timeoutInMinutes: 3
- job: 'e2e_web_linux'
pool:
vmImage: $(linuxImage)
steps:
- template: pipeline/install-node-prerequisites.yaml
- template: pipeline/run-tests-in-docker-linux.yaml
parameters:
target: web
- template: pipeline/e2e-test-publish-results.yaml
- job: 'e2e_unified_mac'
pool:
vmImage: $(macImage)
steps:
- template: pipeline/install-node-prerequisites.yaml
- template: pipeline/unified/unified-e2e-test-interactive.yaml
- template: pipeline/unified/unified-e2e-publish-results.yaml
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))
- job: 'e2e_unified_linux'
pool:
vmImage: $(linuxImage)
steps:
- template: pipeline/install-node-prerequisites.yaml
- template: pipeline/run-tests-in-docker-linux.yaml
parameters:
target: unified
- template: pipeline/unified/unified-e2e-publish-results.yaml
- job: 'e2e_unified_windows'
pool:
vmImage: $(windowsImage)
steps:
- template: pipeline/install-node-prerequisites.yaml
- template: pipeline/unified/unified-e2e-test-interactive.yaml
- template: pipeline/unified/unified-e2e-publish-results.yaml
condition: and(succeeded(), in(variables['Build.Reason'], 'IndividualCI', 'BatchedCI'))