forked from trikset/trik-studio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
261 lines (235 loc) · 8.32 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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
trigger:
branches:
include:
- master
- junior
tags:
include:
- '*'
variables:
CONFIG: release
QMAKE_EXTRA: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache"
EXECUTOR: "time docker exec -i builder"
PROJECT: studio
TESTS: true
ALL_TESTS: "./run-simulator-tests.sh"
TRIK_PYTHON3_VERSION_MINOR: 9
TRIK_QT_VERSION: 5.12
BUILD_TIMEOUT: 2400
CCACHE_CONFIGPATH: "$(Pipeline.Workspace)/ccache.conf"
CCACHE_DIR: "$(Pipeline.Workspace)/.ccache/$(Agent.OS)-$(CONFIG)"
parameters:
- name: checkoutStep
type: step
default:
checkout: self
fetchDepth: 100
submodules: recursive
- name: gitListStep
type: step
default:
bash: |
git tag -l
git branch -a
displayName: Set up the environment
- name: environmentStep
type: step
default:
bash: buildScripts/azure/install_$(Agent.OS).sh
displayName: Set up the environment
- name: cacheStep
type: step
default:
task: Cache@2
inputs:
key: '"ccache-$(Agent.OS)-$(CONFIG)" | "$(Build.SourceVersion)" | "$(QMAKE_EXTRA)"'
path: $(CCACHE_DIR)
restoreKeys: |
"ccache-$(Agent.OS)-$(CONFIG)" | "$(Build.SourceVersion)" | "$(QMAKE_EXTRA)"
"ccache-$(Agent.OS)-$(CONFIG)" | "$(Build.SourceVersion)"
"ccache-$(Agent.OS)-$(CONFIG)" | "$(QMAKE_EXTRA)"
"ccache-$(Agent.OS)-$(CONFIG)"
displayName: Process caches
- name: buildNoTestsStep
type: step
default:
bash: |
buildScripts/azure/build.sh & WPID=$!
sleep $BUILD_TIMEOUT && { echo -e "\033[31;1;7m***KILLED ON TIMEOUT***\033[0m" ; echo "##vso[task.setvariable variable=isTimeout;isOutput=true]Yes" ; pkill -TERM -P $WPID ; } & KPID=$!
wait $WPID ; kill $KPID > /dev/null || true
displayName: 'Build without tests'
- name: buildWithTestsStep
type: step
default:
bash: buildScripts/azure/build.sh
displayName: 'Build with buildWithTests.sh'
- name: buildInstallerStep
type: step
default:
bash: $EXECUTOR env CONFIG=$CONFIG AGENT_OS=$(Agent.OS) ./buildScripts/azure/test.sh && buildScripts/azure/build_installer.sh
env:
password: $(SERVER_PASSWORD)
server: $(SERVER_NAME)
displayName: 'Build installer and deploy'
- name: setTagNameStep
type: step
default:
bash: export BRANCH_NAME="$(git describe --exact-match $(Build.SourceVersion))"
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
displayName: 'Tag name as an environment variable'
- name: publishInstallerArtifact
type: step
default:
publish: installer/
artifact: "$(Agent.OS) installer"
stages:
- stage: lintStage
displayName: Lint stage
jobs:
- job: Lint
pool:
vmImage: ubuntu-latest
steps:
- ${{ parameters.checkoutStep }}
- bash: buildScripts/azure/install_$(Agent.OS).sh
displayName: 'Set up the environment'
- bash: $EXECUTOR buildScripts/azure/vera_translation.sh
displayName: 'vera_translation.sh'
- stage: linuxCacheableBuildStage
displayName: Linux cache build
dependsOn: lintStage
condition: succeeded()
jobs:
- job: Build
strategy:
matrix:
LinuxRelease:
imageName: 'ubuntu-latest'
QMAKE_EXTRA: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off"
LinuxDebug:
imageName: 'ubuntu-latest'
QMAKE_EXTRA: "CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address"
CONFIG: debug
TESTS: $ALL_TESTS
pool:
vmImage: $(imageName)
steps:
- ${{ parameters.checkoutStep }}
- ${{ parameters.environmentStep }}
- ${{ parameters.cacheStep }}
- ${{ parameters.buildNoTestsStep }}
- stage: macOSCacheableBuildStage
displayName: MacOS cache build
dependsOn: lintStage
condition: succeeded()
jobs:
- job: Build
strategy:
matrix:
macOSRelease:
imageName: 'macOS-11'
QMAKE_EXTRA: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off"
EXECUTOR: "time"
macOSDebug:
imageName: 'macOS-11'
QMAKE_EXTRA: "CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address"
CONFIG: debug
TESTS: $ALL_TESTS
EXECUTOR: "time"
pool:
vmImage: $(imageName)
steps:
- ${{ parameters.checkoutStep }}
- ${{ parameters.environmentStep }}
- ${{ parameters.cacheStep }}
- ${{ parameters.buildNoTestsStep }}
- stage: linuxBuildWithTestsStage
displayName: Linux build with tests
dependsOn: linuxCacheableBuildStage
condition: and(succeeded(),and(ne(stageDependencies.linuxCacheableBuildStage.Build.outputs['LinuxRelease.BuildNoTestsStep.isTimeout'],'Yes'),ne(stageDependencies.linuxCacheableBuildStage.Build.outputs['LinuxDebug.BuildNoTestsStep.isTimeout'],'Yes')))
jobs:
- job: Build
strategy:
matrix:
Linux release + tests:
imageName: 'ubuntu-latest'
QMAKE_EXTRA: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off"
Linux release with retired features:
imageName: 'ubuntu-latest'
QMAKE_EXTRA: "CONFIG+=trik_retired_features CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent"
Linux debug + tests:
imageName: 'ubuntu-latest'
QMAKE_EXTRA: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address"
CONFIG: debug
TESTS: $ALL_TESTS
pool:
vmImage: $(imageName)
steps:
- ${{ parameters.checkoutStep }}
- ${{ parameters.environmentStep }}
- ${{ parameters.cacheStep }}
- ${{ parameters.buildWithTestsStep }}
- stage: macOSBuildWithTestsStage
displayName: MacOs build with tests
dependsOn: macOSCacheableBuildStage
condition: and(succeeded(),and(ne(stageDependencies.macOSCacheableBuildStage.Build.outputs['macOSRelease.BuildNoTestsStep.isTimeout'],'Yes'),ne(stageDependencies.macOSCacheableBuildStage.Build.outputs['macOSDebug.BuildNoTestsStep.isTimeout'],'Yes')))
jobs:
- job: Build
strategy:
matrix:
MacOS release + tests:
imageName: 'macOS-11'
QMAKE_EXTRA: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off"
EXECUTOR: "time"
macOS debug + tests:
imageName: 'macOS-11'
QMAKE_EXTRA: "CONFIG+=tests CONFIG+=noPch CONFIG+=ccache CONFIG+=silent CONFIG+=small_debug_info CONFIG+=sanitizer CONFIG+=sanitize_undefined CONFIG+=sanitize_address"
CONFIG: debug
TESTS: $ALL_TESTS
EXECUTOR: "time"
pool:
vmImage: $(imageName)
steps:
- ${{ parameters.checkoutStep }}
- ${{ parameters.environmentStep }}
- ${{ parameters.cacheStep }}
- ${{ parameters.buildWithTestsStep }}
- stage: linuxInstallerStage
displayName: Linux installer
dependsOn: linuxBuildWithTestsStage
condition: succeeded()
jobs:
- job: installer
displayName: "Test, installer, deploy"
variables:
QMAKE_EXTRA: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off"
pool:
vmImage: 'ubuntu-latest'
steps:
- ${{ parameters.checkoutStep }}
- ${{ parameters.environmentStep }}
- ${{ parameters.cacheStep }}
- ${{ parameters.buildNoTestsStep }}
- ${{ parameters.setTagNameStep }}
- ${{ parameters.buildInstallerStep }}
- ${{ parameters.publishInstallerArtifact }}
- stage: macOsInstallerStage
displayName: MacOs installer
dependsOn: macOSBuildWithTestsStage
condition: succeeded()
jobs:
- job: installer
displayName: "Test, installer, deploy"
variables:
QMAKE_EXTRA: "CONFIG+=noPch CONFIG+=ccache CONFIG+=no-sanitizers CONFIG+=silent CONFIG+=warn_off"
EXECUTOR: "time"
pool:
vmImage: 'macOS-11'
steps:
- ${{ parameters.checkoutStep }}
- ${{ parameters.environmentStep }}
- ${{ parameters.cacheStep }}
- ${{ parameters.buildNoTestsStep }}
- ${{ parameters.setTagNameStep }}
- ${{ parameters.buildInstallerStep }}
- ${{ parameters.publishInstallerArtifact }}