-
Notifications
You must be signed in to change notification settings - Fork 3
/
.gitlab-ci.yml
289 lines (271 loc) · 6.43 KB
/
.gitlab-ci.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
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
stages:
- pre-build
- build
- test
- release
- deploy
include: 'https://git.dbogatov.org/templates/ci-snippets/raw/master/trigger-websites-deploy.yml'
variables:
DOTNET_SDK_IMAGE: "dbogatov/docker-sources:microsoft-dotnet-2.2-sdk-alpine"
DOTNET_RUNTIME_IMAGE: "dbogatov/docker-sources:microsoft-dotnet-2.2-runtime-alpine"
build-reproducibility:
stage: release
script:
- docker build -t dbogatov/ore-benchmark:repro -f ./tools/reproducibility/Dockerfile --build-arg CI_BUILD_REF .
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- docker push dbogatov/ore-benchmark:repro
dependencies: []
tags:
- shell
only:
- master
build-docs:
image: dbogatov/docker-sources:tsgkadot-docker-docfx
stage: pre-build
script:
- ./docs/docs.sh
artifacts:
paths:
- ./docs/_site
- ./docs/Dockerfile
- ./docs/nginx.conf
- ./src/web/wwwroot/documentation
only:
- master
tags:
- docker
build-app:
image: $DOTNET_SDK_IMAGE
stage: build
script:
- printf "namespace CLI { public partial class Version { public override string ToString() => \"%s\"; } }" $(echo $CI_BUILD_REF | cut -c1-8) > ./src/cli/Version.cs
- printf "{\"Version\":{\"GitHash\":\"%s\"}}" $(echo $CI_BUILD_REF | cut -c1-8) > src/web/version.json
- dotnet restore src/cli/ --disable-parallel
- dotnet restore src/web/ --disable-parallel
- dotnet restore tools/data-gen/ --disable-parallel
- dotnet restore tools/packages-example/ --disable-parallel
- dotnet publish -c release src/cli/ -o dist/
- dotnet publish -c release src/web/ -o dist/
- dotnet publish -c release tools/data-gen/ -o dist/
- dotnet publish -c release tools/packages-example/ -o dist/
dependencies:
- build-docs
artifacts:
expire_in: 1 day
paths:
- ./src/cli/dist
- ./src/web/dist
- ./tools/data-gen/dist
- ./tools/packages-example/dist
- ./tools/data-gen/generate.sh
- ./tools/simulation/
- ./Dockerfile
- ./src/web/Dockerfile
tags:
- docker
build-tests:
image: $DOTNET_SDK_IMAGE
stage: build
script:
- dotnet restore --disable-parallel test/
- dotnet publish -c release --no-restore test/ -o dist/
artifacts:
expire_in: 1 day
paths:
- ./test/dist
- ./test/test.csproj
tags:
- docker
build-packages:
image: $DOTNET_SDK_IMAGE
stage: build
script:
- apk add --update bash
- ./tools/publish-packages.sh -b -k $NUGET_KEY
artifacts:
paths:
- ./tools/publish-packages.sh
- ./version.txt
- ./src/b-plus-tree/dist/*.nupkg
- ./src/crypto/*/dist/*.nupkg
tags:
- docker
only:
- master
data-gen:
image: $DOTNET_SDK_IMAGE
stage: build
script:
- apk add --update bash
- ./tools/data-gen/generate.sh -d 2500 -q 50 -s 1305
artifacts:
expire_in: 1 day
paths:
- ./data/
tags:
- docker
only:
- master
unit-tests:
image: $DOTNET_SDK_IMAGE
stage: test
script:
- apk add --update bash bc
- ./tools/test-coverage/coverage.sh
- dotnet tool install --global trx2junit --version 1.0.2
- export PATH="$PATH:/root/.dotnet/tools"
- trx2junit test/TestResults/*.trx
- cp test/TestResults/*.xml unit.xml
dependencies: []
artifacts:
reports:
junit: ./unit.xml
paths:
- coverage-html/
tags:
- docker
- heavy
integration-tests:
image: $DOTNET_SDK_IMAGE
variables:
GIT_STRATEGY: none
stage: test
script:
- dotnet test test/test.csproj --output dist/ --no-build --no-restore --verbosity n --logger trx --filter Category=Integration
- dotnet tool install --global trx2junit --version 1.0.2
- export PATH="$PATH:/root/.dotnet/tools"
- trx2junit test/TestResults/*.trx
- cp test/TestResults/*.xml integration.xml
artifacts:
reports:
junit: ./integration.xml
dependencies:
- build-tests
tags:
- docker
system-protocol-tests:
image: $DOTNET_RUNTIME_IMAGE
variables:
GIT_STRATEGY: none
stage: test
script:
- apk add --update bash ruby ruby-bundler
- ./tools/data-gen/generate.sh -d 100 -q 20 -s 1305 -n
- ./tools/simulation/protocol.rb
artifacts:
expire_in: 1 day
paths:
- ./results/protocol.json
dependencies:
- build-app
tags:
- docker
system-schemes-tests:
image: $DOTNET_RUNTIME_IMAGE
variables:
GIT_STRATEGY: none
stage: test
script:
- apk add --update bash ruby ruby-bundler
- ./tools/data-gen/generate.sh -d 100 -s 1305 -n
- ./tools/simulation/pure-schemes.rb
artifacts:
expire_in: 1 day
paths:
- ./results/schemes.json
dependencies:
- build-app
tags:
- docker
published-packages-tests:
image: $DOTNET_RUNTIME_IMAGE
variables:
GIT_STRATEGY: none
stage: test
script:
- dotnet ./tools/packages-example/dist/packages-example.dll
dependencies:
- build-app
only:
- master
tags:
- docker
publish-docker-images:
variables:
GIT_STRATEGY: none
stage: release
script:
- docker build -t dbogatov/ore-benchmark .
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- docker push dbogatov/ore-benchmark
dependencies:
- build-app
- data-gen
tags:
- shell
only:
- master
publish-packages:
image: $DOTNET_SDK_IMAGE
variables:
GIT_STRATEGY: none
stage: release
script:
- apk add --update bash
- ./tools/publish-packages.sh -p -k $NUGET_KEY
dependencies:
- build-packages
allow_failure: true
tags:
- docker
only:
refs:
- master
changes:
- version.txt
docs-website:
variables:
GIT_STRATEGY: none
stage: release
script:
- docker build -t registry.dbogatov.org/bu/ore-benchmark/project-code/docs:$CI_BUILD_REF_NAME docs/
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.dbogatov.org
- docker push registry.dbogatov.org/bu/ore-benchmark/project-code/docs:$CI_BUILD_REF_NAME
dependencies:
- build-docs
tags:
- shell
only:
- master
website:
variables:
GIT_STRATEGY: none
stage: release
script:
- docker build -t registry.dbogatov.org/bu/ore-benchmark/project-code/website:$CI_BUILD_REF_NAME src/web/
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.dbogatov.org
- docker push registry.dbogatov.org/bu/ore-benchmark/project-code/website:$CI_BUILD_REF_NAME
dependencies:
- build-app
tags:
- shell
only:
- master
pages:
image: dbogatov/docker-images:alpine-extras-latest
variables:
GIT_STRATEGY: none
stage: release
script:
- mv docs/_site public/
- echo "Uploading files to pages"
artifacts:
expire_in: 30 min
paths:
- public
dependencies:
- build-docs
tags:
- docker
only:
- master