-
Notifications
You must be signed in to change notification settings - Fork 47
/
azure-pipelines.yml
263 lines (237 loc) · 7.39 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
262
263
trigger:
- master
pr:
- master
jobs:
- job: unit_test_backend
pool:
vmImage: 'ubuntu-20.04'
steps:
- script: |
curl -O https://download.clojure.org/install/linux-install-1.10.1.492.sh
chmod +x linux-install-1.10.1.492.sh
sudo ./linux-install-1.10.1.492.sh
- script: |
cd core
clojure -A:test -e integration
- script: |
cd api
clojure -A:test -e integration
- job: lint_backend
pool:
vmImage: 'ubuntu-20.04'
steps:
- script: |
curl -O https://download.clojure.org/install/linux-install-1.10.1.492.sh
chmod +x linux-install-1.10.1.492.sh
sudo ./linux-install-1.10.1.492.sh
- script: |
curl -O https://raw.githubusercontent.com/borkdude/clj-kondo/master/script/install-clj-kondo
chmod +x install-clj-kondo
sudo ./install-clj-kondo
- script: |
cd api
clj-kondo --lint src test
displayName: 'Lint API'
condition: succeededOrFailed()
- script: |
cd core
clj-kondo --lint src test
displayName: 'Lint Core'
condition: succeededOrFailed()
- job: check_format
continueOnError: true
pool:
vmImage: 'ubuntu-20.04'
steps:
- script: |
curl -O https://download.clojure.org/install/linux-install-1.10.1.492.sh
chmod +x linux-install-1.10.1.492.sh
sudo ./linux-install-1.10.1.492.sh
- script: |
cd api
clojure -Sdeps '{:deps {cljfmt {:mvn/version "0.8.0"}}}' -m cljfmt.main check
displayName: 'Check API format'
condition: succeededOrFailed()
- script: |
cd core
clojure -Sdeps '{:deps {cljfmt {:mvn/version "0.8.0"}}}' -m cljfmt.main check
displayName: 'Check Core format'
condition: succeededOrFailed()
# TODO: fix test timeout
# - job: test_frontend
# pool:
# vmImage: 'ubuntu-20.04'
# steps:
# - task: NodeTool@0
# inputs:
# versionSpec: '11'
# - script: |
# cd front-end
# make test
- job: api_integration_tests
pool:
vmImage: 'ubuntu-20.04'
dependsOn:
- unit_test_backend
steps:
- task: DockerCompose@0
displayName: Build Integration tests dependencies
inputs:
dockerComposeFile: api/docker-compose.test.yml
projectName: $(Build.Repository.Name)
dockerComposeCommand: build
- task: DockerCompose@0
displayName: Run Integration tests
inputs:
dockerComposeFile: api/docker-compose.test.yml
projectName: $(Build.Repository.Name)
dockerComposeCommand: up --remove-orphans --abort-on-container-exit --exit-code-from api
- script: |
python -m pip install --upgrade pip
pip install coverage
displayName: 'Install coverage'
- script: |
bash <(curl -s https://codecov.io/bash) -s api/.stats/coverage/api -F api
displayName: 'Upload to codecov.io'
- job: core_integration_tests
pool:
vmImage: 'ubuntu-20.04'
dependsOn:
- unit_test_backend
steps:
- task: DockerCompose@0
displayName: Build Integration tests dependencies
inputs:
dockerComposeFile: core/docker-compose.test.yml
projectName: $(Build.Repository.Name)
dockerComposeCommand: build
- task: DockerCompose@0
displayName: Run Integration tests
inputs:
dockerComposeFile: core/docker-compose.test.yml
projectName: $(Build.Repository.Name)
dockerComposeCommand: up --remove-orphans --abort-on-container-exit --exit-code-from core
- script: |
python -m pip install --upgrade pip
pip install coverage
displayName: 'Install coverage'
- script: |
bash <(curl -s https://codecov.io/bash) -s core/.stats/coverage/core -F core
displayName: 'Upload to codecov.io'
- job: eval
pool:
vmImage: 'ubuntu-20.04'
steps:
- checkout: self
submodules: true
- task: DockerCompose@0
displayName: Build Eval
inputs:
dockerComposeFile: docker-compose.yml
additionalDockerComposeFiles: docker-compose.eval.yml
projectName: $(Build.Repository.Name)
dockerComposeCommand: build
- task: DockerCompose@0
displayName: Run Eval
inputs:
dockerComposeFile: docker-compose.yml
additionalDockerComposeFiles: docker-compose.eval.yml
projectName: $(Build.Repository.Name)
dockerComposeCommand: up --remove-orphans --abort-on-container-exit --exit-code-from eval
- job: publish
dependsOn:
- unit_test_backend
- lint_backend
- api_integration_tests
- core_integration_tests
- eval
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
pool:
vmImage: 'ubuntu-20.04'
variables:
DOCKER_BUILDKIT: 1
steps:
- task: Docker@2
displayName: Build core image
inputs:
command: build
repository: acctext/core
dockerfile: core/Dockerfile
containerRegistry: dockerhub
tags: |
latest
$(Build.SourceVersion)
arguments: --build-arg BUILDKIT_INLINE_CACHE=1
- task: Docker@2
displayName: Push core image
inputs:
command: push
repository: acctext/core
containerRegistry: dockerhub
tags: |
latest
$(Build.SourceVersion)
- task: Docker@2
displayName: Build front-end image
inputs:
command: build
repository: acctext/frontend
dockerfile: front-end/Dockerfile
containerRegistry: dockerhub
buildContext: .
tags: |
latest
$(Build.SourceVersion)
arguments: --build-arg BUILDKIT_INLINE_CACHE=1
- task: Docker@2
displayName: Push front-end image
inputs:
command: push
repository: acctext/frontend
containerRegistry: dockerhub
tags: |
latest
$(Build.SourceVersion)
- task: Docker@2
displayName: Build api image
inputs:
command: build
repository: acctext/api
dockerfile: api/Dockerfile
containerRegistry: dockerhub
buildContext: .
tags: |
latest
$(Build.SourceVersion)
arguments: --build-arg BUILDKIT_INLINE_CACHE=1
- task: Docker@2
displayName: Push api image
inputs:
command: push
repository: acctext/api
containerRegistry: dockerhub
buildContext: .
tags: |
latest
$(Build.SourceVersion)
- task: Docker@2
displayName: Build gf image
inputs:
command: build
repository: acctext/gf
dockerfile: core/gf/Dockerfile
containerRegistry: dockerhub
tags: |
latest
$(Build.SourceVersion)
arguments: --build-arg BUILDKIT_INLINE_CACHE=1
- task: Docker@2
displayName: Push gf image
inputs:
command: push
repository: acctext/gf
containerRegistry: dockerhub
tags: |
latest
$(Build.SourceVersion)