-
Notifications
You must be signed in to change notification settings - Fork 14
410 lines (387 loc) · 17.7 KB
/
build-and-test.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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
name: CI Actions for DogeCash
on: [push, pull_request]
jobs:
lint:
env:
SHELLCHECK_VERSION: v0.6.0
LC_ALL: C
runs-on: ubuntu-18.04
defaults:
run:
shell: bash
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Initialize Python
uses: actions/setup-python@v2
with:
python-version: 3.5
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install codespell==1.13.0
pip install flake8==3.5.0
pip install vulture==0.29
curl -s "https://storage.googleapis.com/shellcheck/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
export PATH="/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}"
echo $PATH
- name: Set TRAVIS_BRANCH workaround env variable
if: github.event_name == 'pull_request'
run: echo "TRAVIS_BRANCH=${{ github.base_ref }}" >> $GITHUB_ENV
- name: Lint
run: |
git checkout -qf -B master refs/remotes/origin/master
git checkout -qf $GITHUB_SHA
contrib/devtools/git-subtree-check.sh src/secp256k1
contrib/devtools/git-subtree-check.sh src/univalue
contrib/devtools/git-subtree-check.sh src/leveldb
contrib/devtools/git-subtree-check.sh src/crc32c
contrib/devtools/check-doc.py
contrib/devtools/logprint-scanner.py
if [ "${{ github.event_name }}" = "pull_request" ]; then
COMMIT_RANGE="${{ github.base_ref }}..HEAD"
contrib/devtools/lint-whitespace.sh
contrib/devtools/commit-script-check.sh $COMMIT_RANGE
test/lint/lint-qt.sh
fi
cmake:
name: CMake-${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
needs: lint
continue-on-error: true
env:
APT_BASE: ccache
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_SIZE: 500M
CCACHE_COMPRESS: 1
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
config:
- name: Linux
os: ubuntu-16.04
packages: python3-zmq qtbase5-dev qttools5-dev-tools libqt5svg5-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev libgmp-dev libsodium-dev cargo
cc: gcc
cxx: g++
- name: macOS
os: macos-10.15
packages: python3 autoconf automake berkeley-db4 libtool boost miniupnpc pkg-config qt5 zmq libevent qrencode gmp libsodium rust
cc: $(brew --prefix llvm)/bin/clang
cxx: $(brew --prefix llvm)/bin/clang++
steps:
- name: Get Source
uses: actions/checkout@v2
- name: Setup Environment
run: |
if [[ ${{ matrix.config.os }} = ubuntu* ]]; then
sudo apt-add-repository "ppa:ondrej/php" -y
sudo apt-get --yes update
sudo apt-get install --no-install-recommends --no-upgrade -qq "$APT_BASE" ${{ matrix.config.packages }}
fi
if [[ ${{ matrix.config.os }} = macos* ]]; then
brew install "$APT_BASE" ${{ matrix.config.packages }}
fi
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: .ccache
key: cmake-${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
cmake-${{ matrix.config.name }}-ccache-
- name: build
run: |
CC=${{ matrix.config.cc }}
CXX=${{ matrix.config.cxx }}
if [[ ${{ matrix.config.os }} = macos* ]]; then
export CPPFLAGS="-I/usr/local/Cellar/gmp/6.2.1/include"
export LDFLAGS="-L/usr/local/Cellar/gmp/6.2.1/lib"
fi
export CC
export CXX
mkdir -p ${{ github.workspace }}/cmake-build-debug && cd ${{ github.workspace }}/cmake-build-debug
cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" ${{ github.workspace }}
cmake --build ${{ github.workspace }}/cmake-build-debug --target all -- -j 2
build_depends:
name: Depends-${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
needs: lint
env:
APT_BASE: ccache
SDK_URL: https://bitcoincore.org/depends-sources/sdks
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
config:
- name: ARM 32-bit
os: ubuntu-18.04
host: arm-linux-gnueabihf
apt_get: python3 g++-arm-linux-gnueabihf
- name: AARCH64
os: ubuntu-18.04
host: aarch64-linux-gnu
apt_get: python3 g++-aarch64-linux-gnu
- name: Win64
os: ubuntu-18.04
host: x86_64-w64-mingw32
apt_get: python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64
- name: 32-bit + dash
os: ubuntu-18.04
host: i686-pc-linux-gnu
apt_get: g++-multilib python3-zmq
- name: x86_64 Linux
os: ubuntu-18.04
host: x86_64-unknown-linux-gnu
apt_get: python3-zmq qtbase5-dev qttools5-dev-tools libqt5svg5-dev libqt5charts5-dev libqrencode-dev libdbus-1-dev libharfbuzz-dev
dep_opts: NO_QT=1 NO_UPNP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1
- name: macOS 10.12
os: ubuntu-18.04
host: x86_64-apple-darwin16
apt_get: cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools
XCODE_VERSION: 11.3.1
XCODE_BUILD_ID: 11C505
steps:
- name: Get Source
uses: actions/checkout@v2
- name: Setup Environment
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends --no-upgrade -qq "$APT_BASE" ${{ matrix.config.apt_get }}
- name: Prepare Depends timestamp
id: depends_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: depends cache files
uses: actions/cache@v2
with:
path: |
depends/built
depends/sdk-sources
depends/${{ matrix.config.host }}
key: ${{ runner.os }}-depends-${{ matrix.config.host }}-${{ steps.depends_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ runner.os }}-depends-${{ matrix.config.host }}-
- name: Build Depends
run: |
export LC_ALL=C.UTF-8
PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")
# Add llvm-symbolizer directory to PATH. Needed to get symbolized stack traces from the sanitizers.
PATH=$PATH:/usr/lib/llvm-6.0/bin/
export PATH
mkdir -p depends/SDKs depends/sdk-sources
OSX_SDK_BASENAME="Xcode-${{ matrix.config.XCODE_VERSION }}-${{ matrix.config.XCODE_BUILD_ID }}-extracted-SDK-with-libcxx-headers.tar.gz"
OSX_SDK_PATH="depends/sdk-sources/${OSX_SDK_BASENAME}"
if [ -n "${{ matrix.config.XCODE_VERSION }}" ] && [ ! -f "$OSX_SDK_PATH" ]; then
curl --location --fail "${SDK_URL}/${OSX_SDK_BASENAME}" -o "$OSX_SDK_PATH"
fi
if [ -n "${{ matrix.config.XCODE_VERSION }}" ] && [ -f "$OSX_SDK_PATH" ]; then
tar -C "depends/SDKs" -xf "$OSX_SDK_PATH"
fi
if [[ ${{ matrix.config.host }} = *-mingw32 ]]; then
BIN=$(which ${{ matrix.config.host }}-g++-posix)
sudo update-alternatives --set ${{ matrix.config.host }}-g++ $BIN
fi
if [ -z "${{ matrix.config.no_depends }}" ]; then
make -j2 -C depends HOST=${{ matrix.config.host }} ${{ matrix.config.dep_opts }}
fi
build_wallet:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
needs: [lint, build_depends]
env:
APT_BASE: ccache
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_SIZE: 500M
CCACHE_COMPRESS: 1
PARAMS_DIR: ${{ github.workspace }}/.dogecash-params
WINEDEBUG: fixme-all
BOOST_TEST_RANDOM: 1${{ github.run_id }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
config:
- name: ARM 32-bit [GOAL:install] [no unit or functional tests]
os: ubuntu-18.04
host: arm-linux-gnueabihf
apt_get: python3 g++-arm-linux-gnueabihf
unit_tests: false
functional_tests: false
goal: install
# -Wno-psabi is to disable ABI warnings: "note: parameter passing for argument of type ... changed in GCC 7.1"
# This could be removed once the ABI change warning does not show up by default
BITCOIN_CONFIG: "--with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports --disable-online-rust CXXFLAGS=-Wno-psabi"
- name: AARCH64 [GOAL:install] [no unit or functional tests]
os: ubuntu-18.04
host: aarch64-linux-gnu
apt_get: python3 g++-aarch64-linux-gnu
unit_tests: false
functional_tests: false
goal: install
BITCOIN_CONFIG: "--with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports --disable-online-rust"
- name: Win64 [GOAL:deploy] [no functional tests]
os: ubuntu-18.04
host: x86_64-w64-mingw32
apt_get: python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64
unit_tests: true
functional_tests: false
goal: deploy
BITCOIN_CONFIG: "--with-gui=auto --enable-reduce-exports --disable-online-rust"
- name: x86_64 Linux [GOAL:install] [bionic]
os: ubuntu-18.04
host: x86_64-unknown-linux-gnu
apt_get: python3-zmq qtbase5-dev qttools5-dev-tools libqt5svg5-dev libqt5charts5-dev libqrencode-dev libdbus-1-dev libharfbuzz-dev
unit_tests: true
functional_tests: true
goal: install
test_runner_extra: "--coverage --all --exclude feature_dbcrash"
BITCOIN_CONFIG: "--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports --disable-online-rust"
- name: x86_64 Linux [GOAL:install] [bionic] [no GUI no unit tests - only functional tests on legacy pre-HD wallets]
os: ubuntu-18.04
host: x86_64-unknown-linux-gnu
apt_get: python3-zmq
unit_tests: false
functional_tests: true
goal: install
test_runner_extra: "--legacywallet"
BITCOIN_CONFIG: "--enable-zmq --with-gui=no --enable-glibc-back-compat --enable-reduce-exports --disable-online-rust"
- name: x86_64 Linux [GOAL:install] [xenial] [no depends only system libs]
os: ubuntu-16.04
host: x86_64-unknown-linux-gnu
apt_get: python3-zmq qtbase5-dev qttools5-dev-tools libqt5svg5-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev libgmp-dev libsodium-dev cargo
unit_tests: true
functional_tests: true
no_depends: 1
goal: install
test_runner_extra: "--all --exclude feature_dbcrash"
BITCOIN_CONFIG: "--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER --disable-hardening --disable-asm"
- name: x86_64 Linux [GOAL:install] [bionic] [no depends only system libs]
os: ubuntu-18.04
host: x86_64-unknown-linux-gnu
apt_get: python3-zmq qtbase5-dev qttools5-dev-tools libqt5svg5-dev libqt5charts5-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libzmq3-dev libqrencode-dev libgmp-dev libsodium-dev cargo
unit_tests: true
no_depends: 1
goal: install
BITCOIN_CONFIG: "--enable-zmq --with-incompatible-bdb --with-gui=qt5 CPPFLAGS=-DDEBUG_LOCKORDER"
- name: macOS 10.12 [GOAL:deploy] [no functional tests]
os: ubuntu-18.04
host: x86_64-apple-darwin16
apt_get: cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python3-dev python3-setuptools
XCODE_VERSION: 11.3.1
XCODE_BUILD_ID: 11C505
unit_tests: false
functional_tests: false
goal: deploy
BITCOIN_CONFIG: "--enable-gui --enable-reduce-exports --enable-werror --disable-online-rust"
steps:
- name: Get Source
uses: actions/checkout@v2
- name: Setup Environment
run: |
sudo apt-add-repository "ppa:ondrej/php" -y
sudo apt-get --yes update
sudo apt-get install --no-install-recommends --no-upgrade -qq "$APT_BASE" ${{ matrix.config.apt_get }}
- name: depends cache files
if: matrix.config.no_depends != 1
uses: actions/cache@v2
with:
path: |
depends/built
depends/sdk-sources
depends/${{ matrix.config.host }}
key: ${{ runner.os }}-depends-${{ matrix.config.host }}-
restore-keys: |
${{ runner.os }}-depends-${{ matrix.config.host }}-
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: ccache cache files
uses: actions/cache@v2
with:
path: |
.ccache
.dogecash-params
key: ${{ matrix.config.name }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ matrix.config.name }}-ccache-
- name: Build Wallet
run: |
export LC_ALL=C.UTF-8
echo $CCACHE_DIR
echo $PARAMS_DIR
PATH=$(echo $PATH | tr ':' "\n" | sed '/\/opt\/python/d' | tr "\n" ":" | sed "s|::|:|g")
# Add llvm-symbolizer directory to PATH. Needed to get symbolized stack traces from the sanitizers.
PATH=$PATH:/usr/lib/llvm-6.0/bin/
export PATH
mkdir -p depends/SDKs depends/sdk-sources
OSX_SDK_BASENAME="Xcode-${{ matrix.config.XCODE_VERSION }}-${{ matrix.config.XCODE_BUILD_ID }}-extracted-SDK-with-libcxx-headers.tar.gz"
OSX_SDK_PATH="depends/sdk-sources/${OSX_SDK_BASENAME}"
if [ -n "${{ matrix.config.XCODE_VERSION }}" ] && [ ! -f "$OSX_SDK_PATH" ]; then
curl --location --fail "${SDK_URL}/${OSX_SDK_BASENAME}" -o "$OSX_SDK_PATH"
fi
if [ -n "${{ matrix.config.XCODE_VERSION }}" ] && [ -f "$OSX_SDK_PATH" ]; then
tar -C "depends/SDKs" -xf "$OSX_SDK_PATH"
fi
if [[ ${{ matrix.config.host }} = *-mingw32 ]]; then
BIN=$(which ${{ matrix.config.host }}-g++-posix)
sudo update-alternatives --set ${{ matrix.config.host }}-g++ $BIN
sudo update-binfmts --import /usr/share/binfmts/wine
fi
OUTDIR_PATH="$GITHUB_WORKSPACE/$GITHUB_RUN_NUMBER-${{ matrix.config.host }}"
BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$GITHUB_WORKSPACE/depends/${{ matrix.config.host }} --bindir=$OUTDIR_PATH/bin --libdir=$OUTDIR_PATH/lib"
if [ "${{ matrix.config.unit_tests }}" = "true" ] || [ "${{ matrix.config.functional_tests }}" = "true" ]; then
mkdir -p $PARAMS_DIR
PARAMS_FLAGS="--with-params-dir=$PARAMS_DIR"
fi
echo ::group::Autogen
./autogen.sh
echo ::endgroup::
mkdir build && cd build
echo ::group::Configure
../configure --cache-file=config.cache $BITCOIN_CONFIG_ALL ${{ matrix.config.BITCOIN_CONFIG }} $PARAMS_FLAGS || ( cat config.log && false)
echo ::endgroup::
echo ::group::Distdir
make distdir VERSION=${{ matrix.config.host }}
echo ::endgroup::
cd dogecash-${{ matrix.config.host }}
echo ::group::Configure
./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL ${{ matrix.config.BITCOIN_CONFIG }} $PARAMS_FLAGS || ( cat config.log && false)
echo ::endgroup
echo ::group::Build
make -j2 ${{ matrix.config.goal }} || ( echo "Build failure. Verbose build follows." && make ${{ matrix.config.goal }} V=1 ; false )
echo ::endgroup::
if [ "${{ matrix.config.unit_tests }}" = "true" ] || [ "${{ matrix.config.functional_tests }}" = "true" ]; then
echo ::group::Params
./params/install-params.sh $PARAMS_DIR
echo ::endgroup::
fi
if [ "${{ matrix.config.unit_tests }}" = "true" ]; then
echo ::group::Unit-Tests
LD_LIBRARY_PATH=$GITHUB_WORKSPACE/depends/"${{ matrix.config.host }}"/lib make -j2 check VERBOSE=1
echo ::endgroup::
fi
if [ "${{ matrix.config.functional_tests }}" = "true" ]; then
echo ::group::Functional-Tests
test/functional/test_runner.py --combinedlogslen=4000 ${{ matrix.config.test_runner_extra }}
echo ::endgroup::
fi