forked from stakecube/StakeCubeCoin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
331 lines (297 loc) · 8.47 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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
image: "ubuntu:bionic"
variables:
DOCKER_DRIVER: overlay2
FAST_MODE: "false" # when "true", only run linter on arm and unit/functional tests on linux64, skip everything else
workflow:
rules:
- when: always
stages:
- builder-image
- build-depends
- build
- test
builder-image:
stage: builder-image
image: docker:19.03.5
services:
- docker:19.03.5-dind
variables:
DOCKER_HOST: "tcp://docker:2375"
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: ""
before_script:
- echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
script:
- cd contrib/containers/ci
- docker pull $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG || true
- docker pull $CI_REGISTRY_IMAGE:builder-develop || true
- docker build --cache-from $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG --cache-from $CI_REGISTRY_IMAGE:builder-develop -t $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG -f Dockerfile .
- docker push $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG
.build-depends-template:
stage: build-depends
image: $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG
variables:
SDK_URL: https://bitcoincore.org/depends-sources/sdks
XCODE_VERSION: "12.1"
XCODE_BUILD_ID: 12A7403
MAKEJOBS: -j4
before_script:
- echo HOST=$HOST
- |
if [ "$HOST" = "x86_64-apple-darwin19" ]; then
mkdir -p depends/SDKs
mkdir -p depends/sdk-sources
OSX_SDK_BASENAME="Xcode-${XCODE_VERSION}-${XCODE_BUILD_ID}-extracted-SDK-with-libcxx-headers.tar.gz"
OSX_SDK_PATH="depends/sdk-sources/${OSX_SDK_BASENAME}"
if [ ! -f "$OSX_SDK_PATH" ]; then
echo "Downloading MacOS SDK"
curl --location --fail "${SDK_URL}/${OSX_SDK_BASENAME}" -o "$OSX_SDK_PATH"
fi
if [ -f "$OSX_SDK_PATH" ]; then
echo "Extracting MacOS SDK"
tar -C depends/SDKs -xf "$OSX_SDK_PATH"
fi
fi
script:
- make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS
cache:
# Let all branches share the same cache, which is ok because the depends subsystem is able to handle this properly (it works with hashes of all scripts)
key:
files:
- contrib/containers/ci/Dockerfile
prefix: ${CI_JOB_NAME}
paths:
- depends/built
- depends/sdk-sources
artifacts:
name: depends
when: on_success
paths:
- depends/$HOST
- depends/SDKs
.base-template:
image: $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG
before_script:
- export CACHE_DIR=$CI_PROJECT_DIR/cache
- echo BUILD_TARGET=$BUILD_TARGET
- source ./ci/scc/matrix.sh
# Setup some environment variables
- |
if [ "$CI_EXTERNAL_PULL_REQUEST_IID" != "" ]; then
export PULL_REQUEST="true"
else
# CI_EXTERNAL_PULL_REQUEST_IID is false every time until https://gitlab.com/gitlab-org/gitlab/issues/5667 is done
# Until then, we're using https://github.com/brndnmtthws/labhub atm to mirror Github pull requests as branches into Gitlab,
# which allows us to use Gitlab CI for Github. The following check detects such mirrored branches.
if [[ $CI_COMMIT_REF_NAME =~ ^pr-[^/]*/[^/]*/[^/]*/[^/]*$ ]]; then
export PULL_REQUEST="true"
# CI_COMMIT_BEFORE_SHA is also invalid until #5667 is implemented, so we need to figure it out by ourself
git fetch origin develop
export CI_COMMIT_BEFORE_SHA="$(git merge-base origin/develop HEAD)"
else
export PULL_REQUEST="false"
fi
fi
- export COMMIT_RANGE="$CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA"
- export JOB_NUMBER="$CI_JOB_ID"
- export HOST_SRC_DIR=$CI_PROJECT_DIR
- echo PULL_REQUEST=$PULL_REQUEST COMMIT_RANGE=$COMMIT_RANGE HOST_SRC_DIR=$HOST_SRC_DIR CACHE_DIR=$CACHE_DIR
- echo "Commit log:" && git log --format=fuller -1
.build-template:
stage: build
extends: .base-template
script:
- ./ci/scc/build_src.sh
- ./ci/scc/test_unittests.sh # Run unit tests in build stage to avoid creating too many parallel jobs
cache:
# Let all branches share the same cache, which is ok because ccache is able to handle it
key:
files:
- contrib/containers/ci/Dockerfile
prefix: ${CI_JOB_NAME}
paths:
- cache/ccache
artifacts:
name: binaries
when: always
paths:
- build-ci
# Exclude some less important binaries to reduce the size of the artifacts
exclude:
- build-ci/scccore-$BUILD_TARGET/src/bench/bench_scc
- build-ci/scccore-$BUILD_TARGET/src/bench/bench_scc.exe
- build-ci/scccore-$BUILD_TARGET/src/qt/test/test_scc-qt
- build-ci/scccore-$BUILD_TARGET/src/qt/test/test_scc-qt.exe
- build-ci/scccore-$BUILD_TARGET/src/test/test_scc
- build-ci/scccore-$BUILD_TARGET/src/test/test_scc.exe
- build-ci/scccore-$BUILD_TARGET/src/test/fuzz/*
expire_in: 3 days
.test-template:
stage: test
extends: .base-template
variables:
INTEGRATION_TESTS_ARGS: "--extended --exclude feature_pruning,feature_dbcrash"
script:
- echo "INTEGRATION_TESTS_ARGS=${INTEGRATION_TESTS_ARGS}"
- ./ci/scc/test_integrationtests.sh $INTEGRATION_TESTS_ARGS
after_script:
- mkdir -p $CI_PROJECT_DIR/testlogs
artifacts:
name: testlogs
when: always
paths:
- testlogs
expire_in: 3 days
.skip-in-fast-mode-template:
rules:
- if: '$FAST_MODE == "true"'
when: never
- when: always
###
arm-linux-gnueabihf:
extends: .build-depends-template
variables:
HOST: arm-linux-gnueabihf
x86_64-w64-mingw32:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
variables:
HOST: x86_64-w64-mingw32
i686-pc-linux-gnu:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
variables:
HOST: i686-pc-linux-gnu
x86_64-unknown-linux-gnu-debug:
extends: .build-depends-template
variables:
HOST: x86_64-unknown-linux-gnu
DEP_OPTS: "DEBUG=1"
x86_64-unknown-linux-gnu-nowallet:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
variables:
HOST: x86_64-unknown-linux-gnu
DEP_OPTS: "NO_WALLET=1"
x86_64-unknown-linux-gnu-release:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
variables:
HOST: x86_64-unknown-linux-gnu
DEP_OPTS: "NO_UPNP=1"
x86_64-apple-darwin19:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
variables:
HOST: x86_64-apple-darwin19
###
arm-linux-build:
extends: .build-template
needs:
- arm-linux-gnueabihf
variables:
BUILD_TARGET: arm-linux
win64-build:
extends:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-w64-mingw32
variables:
BUILD_TARGET: win64
linux32-build:
extends:
- .build-template
- .skip-in-fast-mode-template
needs:
- i686-pc-linux-gnu
variables:
BUILD_TARGET: linux32
linux32_ubsan-build:
extends:
- .build-template
- .skip-in-fast-mode-template
needs:
- i686-pc-linux-gnu
variables:
BUILD_TARGET: linux32_ubsan
linux64-build:
extends: .build-template
needs:
- x86_64-unknown-linux-gnu-debug
variables:
BUILD_TARGET: linux64
linux64_cxx20-build:
extends: .build-template
needs:
- x86_64-unknown-linux-gnu-debug
variables:
BUILD_TARGET: linux64_cxx20
linux64_tsan-build:
extends:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-unknown-linux-gnu-debug
variables:
BUILD_TARGET: linux64_tsan
linux64_nowallet-build:
extends:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-unknown-linux-gnu-nowallet
variables:
BUILD_TARGET: linux64_nowallet
linux64_release-build:
extends:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-unknown-linux-gnu-release
variables:
BUILD_TARGET: linux64_release
mac-build:
extends:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-apple-darwin19
variables:
BUILD_TARGET: mac
###
linux32-test:
extends:
- .test-template
- .skip-in-fast-mode-template
needs:
- linux32-build
variables:
BUILD_TARGET: linux32
linux32_ubsan-test:
extends:
- .test-template
- .skip-in-fast-mode-template
needs:
- linux32_ubsan-build
variables:
BUILD_TARGET: linux32_ubsan
linux64-test:
extends: .test-template
needs:
- linux64-build
variables:
BUILD_TARGET: linux64
linux64_tsan-test:
extends:
- .test-template
- .skip-in-fast-mode-template
needs:
- linux64_tsan-build
variables:
BUILD_TARGET: linux64_tsan