forked from CoinBlack/electrum-blk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
345 lines (335 loc) · 11.1 KB
/
.cirrus.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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
task:
container:
image: $ELECTRUM_IMAGE
cpu: 1
memory: 2G
matrix:
- name: "unittests: Tox Python $ELECTRUM_PYTHON_VERSION"
env:
ELECTRUM_IMAGE: python:$ELECTRUM_PYTHON_VERSION
TOXENV: py3
ELECTRUM_PYTHON_NAME: python3
matrix:
- env:
ELECTRUM_PYTHON_VERSION: 3.8
- env:
ELECTRUM_PYTHON_VERSION: 3.9
- env:
ELECTRUM_PYTHON_VERSION: 3.10
- env:
ELECTRUM_PYTHON_VERSION: 3.11
- env:
ELECTRUM_PYTHON_VERSION: 3.12
- name: "unittests: Tox Python 3 debug mode"
env:
ELECTRUM_PYTHON_VERSION: 3.11
# enable additional checks:
PYTHONASYNCIODEBUG: "1"
PYTHONDEVMODE: "1"
pip_cache:
folder: ~/.cache/pip
fingerprint_script: echo $ELECTRUM_IMAGE && cat $ELECTRUM_REQUIREMENTS_CI && cat $ELECTRUM_REQUIREMENTS
version_script:
- $ELECTRUM_PYTHON_NAME --version
tag_script:
- git tag
install_script:
- apt-get update
# qml test reqs:
- apt-get -y install libgl1 libegl1 libxkbcommon0 libdbus-1-3
- pip install -r $ELECTRUM_REQUIREMENTS_CI
libsecp_build_cache:
folder: contrib/_saved_secp256k1_build
fingerprint_script: sha256sum ./contrib/make_libsecp256k1.sh
populate_script:
- apt-get -y install automake libtool
- ./contrib/make_libsecp256k1.sh
- mkdir contrib/_saved_secp256k1_build
- cp electrum_blk/libsecp256k1.so.* contrib/_saved_secp256k1_build/
libsecp_install_script:
- cp contrib/_saved_secp256k1_build/* electrum/
tox_script:
- export PYTHONASYNCIODEBUG
- export PYTHONDEVMODE
- tox
coveralls_script:
- if [ ! -z "$COVERALLS_REPO_TOKEN" ] ; then coveralls ; fi
env:
ELECTRUM_REQUIREMENTS_CI: contrib/requirements/requirements-ci.txt
ELECTRUM_REQUIREMENTS: contrib/requirements/requirements.txt
# following CI_* env vars are set up for coveralls
CI_NAME: "CirrusCI"
CI_BUILD_NUMBER: $CIRRUS_BUILD_ID
CI_JOB_ID: $CIRRUS_TASK_ID
CI_BUILD_URL: "https://cirrus-ci.com/task/$CIRRUS_TASK_ID"
CI_BRANCH: $CIRRUS_BRANCH
CI_PULL_REQUEST: $CIRRUS_PR
# in addition, COVERALLS_REPO_TOKEN is set as an "override" in https://cirrus-ci.com/settings/...
depends_on:
- "linter: Flake8 Mandatory"
task:
name: "locale: upload to crowdin"
container:
image: $ELECTRUM_IMAGE
cpu: 1
memory: 1G
pip_cache:
folder: ~/.cache/pip
fingerprint_script: echo Locale && echo $ELECTRUM_IMAGE && cat $ELECTRUM_REQUIREMENTS_CI
install_script:
- apt-get update
- apt-get -y install gettext qttools5-dev-tools
- pip install -r $ELECTRUM_REQUIREMENTS_CI
- pip install requests
locale_script:
- contrib/push_locale
env:
ELECTRUM_IMAGE: python:3.8
ELECTRUM_REQUIREMENTS_CI: contrib/requirements/requirements-ci.txt
# in addition, crowdin_api_key is set as an "override" in https://cirrus-ci.com/settings/...
depends_on:
- "unittests: Tox Python 3.8"
only_if: $CIRRUS_BRANCH == 'master'
task:
name: "Regtest functional tests"
compute_engine_instance:
image_project: cirrus-images
image: family/docker-builder
platform: linux
cpu: 1
memory: 1G
pip_cache:
folder: ~/.cache/pip
fingerprint_script: echo Regtest && echo docker_builder && cat $ELECTRUM_REQUIREMENTS
bitcoind_cache:
folder: /tmp/blackmored
populate_script: mkdir -p /tmp/blackmored
install_script:
- apt-get update
- apt-get -y install curl jq bc
# install electrum
- pip3 install .[tests]
# install e-x some commits after 1.16.0 tag
- pip3 install git+https://github.com/spesmilo/electrumx.git@4e66804dc0d668cd6bd4602b547e2f5b2e227e97
- "BITCOIND_VERSION=$(curl https://blackcoinmore.org/ | grep -E -i --only-matching 'Latest version: [0-9\\.]+' | grep -E --only-matching '[0-9\\.]+')"
- BITCOIND_FILENAME=blackmore-$BITCOIND_VERSION-x86_64-linux-gnu.tar.gz
- BITCOIND_PATH=/tmp/blackmored/$BITCOIND_FILENAME
- BITCOIND_URL=https://blackcoinmore.org/files/blackcoin-more-$BITCOIND_VERSION/$BITCOIND_FILENAME
- tar -xaf $BITCOIND_PATH || (rm -f /tmp/blackmored/* && curl --output $BITCOIND_PATH $BITCOIND_URL && tar -xaf $BITCOIND_PATH)
- cp -a blackmore-$BITCOIND_VERSION/* /usr/
libsecp_build_cache:
folder: contrib/_saved_secp256k1_build
fingerprint_script: sha256sum ./contrib/make_libsecp256k1.sh
populate_script:
- apt-get -y install automake libtool
- ./contrib/make_libsecp256k1.sh
- mkdir contrib/_saved_secp256k1_build
- cp electrum_blk/libsecp256k1.so.* contrib/_saved_secp256k1_build/
libsecp_install_script:
- cp contrib/_saved_secp256k1_build/* electrum_blk/
bitcoind_service_background_script:
- tests/regtest/run_bitcoind.sh
electrumx_service_background_script:
- tests/regtest/run_electrumx.sh
regtest_script:
- sleep 10s
- python3 -m unittest tests/regtest.py
env:
ELECTRUM_REQUIREMENTS: contrib/requirements/requirements.txt
# ElectrumX exits with an error without this:
ALLOW_ROOT: 1
depends_on:
- "linter: Flake8 Mandatory"
task:
container:
image: $ELECTRUM_IMAGE
cpu: 1
memory: 1G
pip_cache:
folder: ~/.cache/pip
fingerprint_script: echo Flake8 && echo $ELECTRUM_IMAGE && cat $ELECTRUM_REQUIREMENTS
install_script:
- pip install "flake8==7.0.0" "flake8-bugbear==24.1.16"
flake8_script:
- flake8 . --count --select="$ELECTRUM_LINTERS" --ignore="$ELECTRUM_LINTERS_IGNORE" --show-source --statistics --exclude "*_pb2.py,electrum_blk/_vendor/"
env:
ELECTRUM_IMAGE: python:3.8
ELECTRUM_REQUIREMENTS: contrib/requirements/requirements.txt
matrix:
- name: "linter: Flake8 Mandatory"
env:
# list of error codes:
# - https://flake8.pycqa.org/en/latest/user/error-codes.html
# - https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
# - https://github.com/PyCQA/flake8-bugbear/tree/8c0e7eb04217494d48d0ab093bf5b31db0921989#list-of-warnings
ELECTRUM_LINTERS: E9,E101,E129,E273,E274,E703,E71,E722,F63,F7,F82,W191,W29,B
ELECTRUM_LINTERS_IGNORE: B007,B009,B010,B019,B036
- name: "linter: Flake8 Non-Mandatory"
env:
ELECTRUM_LINTERS: E,F,W,C90,B
ELECTRUM_LINTERS_IGNORE: ""
allow_failures: true
# Cron jobs configured in https://cirrus-ci.com/settings/...
# - job "nightly" on branch "master" at "0 30 2 * * ?" (every day at 02:30Z)
task:
name: "build: Windows"
matrix:
- trigger_type: manual
only_if: $CIRRUS_CRON == ""
- trigger_type: automatic
only_if: $CIRRUS_CRON == "nightly"
container:
dockerfile: contrib/build-wine/Dockerfile
cpu: 1
memory: 2G
pip_cache:
folder: contrib/build-wine/.cache/win32/wine_pip_cache
fingerprint_script:
- echo $CIRRUS_TASK_NAME
- git ls-files -s contrib/deterministic-build/*.txt
- git ls-files -s contrib/build-wine/
build2_cache:
folder: contrib/build-wine/.cache/win32/build
fingerprint_script:
- echo $CIRRUS_TASK_NAME
- cat contrib/make_libsecp256k1.sh | sha256sum
- cat contrib/make_libusb.sh | sha256sum
- cat contrib/make_zbar.sh | sha256sum
- git ls-files -s contrib/build-wine/
build_script:
- cd contrib/build-wine
- ./make_win.sh
binaries_artifacts:
path: "contrib/build-wine/dist/*"
env:
CIRRUS_WORKING_DIR: /opt/wine64/drive_c/electrum-blk
CIRRUS_DOCKER_CONTEXT: contrib/build-wine
depends_on:
- "unittests: Tox Python 3.8"
task:
name: "build: Android (QML $APK_ARCH)"
matrix:
- trigger_type: manual
only_if: $CIRRUS_CRON == ""
- trigger_type: automatic
only_if: $CIRRUS_CRON == "nightly"
timeout_in: 90m
container:
dockerfile: contrib/android/Dockerfile
cpu: 8
memory: 24G
env:
APK_ARCH: arm64-v8a
packages_tld_folder_cache:
folder: packages
fingerprint_script:
- echo $CIRRUS_TASK_NAME && cat contrib/deterministic-build/requirements.txt && cat contrib/make_packages.sh
- git ls-files -s contrib/android/
p4a_cache:
folders:
- ".buildozer/android/platform/build-$APK_ARCH/packages"
- ".buildozer/android/platform/build-$APK_ARCH/build"
fingerprint_script:
# note: should *at least* depend on Dockerfile and p4a_recipes/, but contrib/android/ is simplest
- git ls-files -s contrib/android/
- echo "qml $APK_ARCH"
build_script:
- ./contrib/android/make_apk.sh qml "$APK_ARCH" debug
binaries_artifacts:
path: "dist/*"
depends_on:
- "unittests: Tox Python 3.8"
## mac build disabled, as Cirrus CI no longer supports Intel-based mac builds
#task:
# name: "build: macOS"
# macos_instance:
# image: catalina-xcode-11.3.1
# env:
# TARGET_OS: macOS
# pip_cache:
# folder: ~/Library/Caches/pip
# fingerprint_script:
# - echo $CIRRUS_TASK_NAME
# - git ls-files -s contrib/deterministic-build/*.txt
# - git ls-files -s contrib/osx/
# build2_cache:
# folder: contrib/osx/.cache
# fingerprint_script:
# - echo $CIRRUS_TASK_NAME
# - cat contrib/make_libsecp256k1.sh | shasum -a 256
# - cat contrib/make_libusb.sh | shasum -a 256
# - cat contrib/make_zbar.sh | shasum -a 256
# - git ls-files -s contrib/osx/
# install_script:
# - git fetch --all --tags
# build_script:
# - ./contrib/osx/make_osx.sh
# sum_script:
# - ls -lah dist
# - shasum -a 256 dist/*.dmg
# binaries_artifacts:
# path: "dist/*"
task:
name: "build: AppImage"
matrix:
- trigger_type: manual
only_if: $CIRRUS_CRON == ""
- trigger_type: automatic
only_if: $CIRRUS_CRON == "nightly"
container:
dockerfile: contrib/build-linux/appimage/Dockerfile
cpu: 2
memory: 2G
pip_cache:
folder: contrib/build-linux/appimage/.cache/pip_cache
fingerprint_script:
- echo $CIRRUS_TASK_NAME
- git ls-files -s contrib/deterministic-build/*.txt
- git ls-files -s contrib/build-linux/appimage/
build2_cache:
folder: contrib/build-linux/appimage/.cache/appimage
fingerprint_script:
- echo $CIRRUS_TASK_NAME
- cat contrib/make_libsecp256k1.sh | sha256sum
- git ls-files -s contrib/build-linux/appimage/
build_script:
- ./contrib/build-linux/appimage/make_appimage.sh
binaries_artifacts:
path: "dist/*"
env:
CIRRUS_DOCKER_CONTEXT: contrib/build-linux/appimage
depends_on:
- "unittests: Tox Python 3.8"
task:
container:
dockerfile: contrib/build-linux/sdist/Dockerfile
cpu: 1
memory: 1G
pip_cache:
folder: ~/.cache/pip
fingerprint_script:
- echo $CIRRUS_TASK_NAME
- git ls-files -s contrib/deterministic-build/*.txt
- git ls-files -s contrib/build-linux/sdist/
build_script:
- ./contrib/build-linux/sdist/make_sdist.sh
binaries_artifacts:
path: "dist/*"
matrix:
- name: "build: tarball"
- name: "build: source-only tarball"
env:
OMIT_UNCLEAN_FILES: 1
depends_on:
- "unittests: Tox Python 3.8"
task:
name: "check submodules"
container:
image: python:3.8
cpu: 1
memory: 1G
fetch_script:
- git fetch --all --tags
check_script:
- ./contrib/deterministic-build/check_submodules.sh
only_if: $CIRRUS_TAG != ''