forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 714
805 lines (693 loc) · 30.8 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
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
# Copyright (c) 2020-2024 The PIVX Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
name: CI Actions for PIVX
on: [push, pull_request]
jobs:
# Pre-build linting job. This runs various lint tests.
# Any failures here will halt the rest of the workflow.
lint:
env:
SHELLCHECK_VERSION: v0.7.1
LC_ALL: C
runs-on: ubuntu-20.04
defaults:
run:
shell: bash
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Initialize Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install codespell==2.2.5
pip install flake8==5.0.4
pip install mypy==1.4.1
pip install vulture==2.6
pip install yq
curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
- 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: |
export PATH="/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}"
git checkout -qf -B master refs/remotes/origin/master
git checkout -qf $GITHUB_SHA
# Ensure git subtrees are not directly modified in-tree.
test/lint/git-subtree-check.sh src/secp256k1
test/lint/git-subtree-check.sh src/univalue
test/lint/git-subtree-check.sh src/leveldb
test/lint/git-subtree-check.sh src/crc32c
test/lint/git-subtree-check.sh src/chiabls
test/lint/git-subtree-check.sh src/immer
# Check command line argument documentation is present.
test/lint/check-doc.py
# Ensure that all logprint(f) calls have the appropriate number of arguments.
test/lint/logprint-scanner.py
# Run the remainder of lint tests in `test/lint/`.
test/lint/lint-all.sh
# Verify that scripted diffs are deterministically reproducable.
if [ "${{ github.event_name }}" = "pull_request" ]; then
COMMIT_RANGE="${{ github.base_ref }}..HEAD"
test/lint/commit-script-check.sh $COMMIT_RANGE
fi
# CMake build jobs to ensure building with CMake remains viable.
# Currently this only supports native linux and macOS.
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-20.04
python-version: '3.8'
packages: python3-zmq qttools5-dev 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
cc: gcc
cxx: g++
- name: Linux-latest
os: ubuntu-latest
python-version: '3.8'
packages: python3-zmq qttools5-dev 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
cc: gcc
cxx: g++
- name: macOS
os: macos-12
python-version: '3.8'
packages: llvm@13 autoconf automake berkeley-db@4 libtool boost@1.76 miniupnpc libnatpmp pkg-config qt@5 zmq libevent qrencode gmp libsodium
boost_root: true
cc: $(brew --prefix llvm@13)/bin/clang
cxx: $(brew --prefix llvm@13)/bin/clang++
- name: macOS-latest
os: macos-14
python-version: '3.10'
packages: llvm@14 autoconf automake berkeley-db@4 libtool boost@1.76 miniupnpc libnatpmp pkg-config qt@5 zmq libevent qrencode gmp libsodium
boost_root: true
cc: $(brew --prefix llvm@14)/bin/clang
cxx: $(brew --prefix llvm@14)/bin/clang++
steps:
- name: Get Source
uses: actions/checkout@v4
- name: Initialize Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config.python-version }}
- name: Setup Environment
run: |
if [[ ${{ matrix.config.os }} = ubuntu* ]]; then
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: ccache cache files
uses: actions/cache@v4
with:
path: .ccache
key: ${{ runner.os }}-cmake-${{ matrix.config.name }}-ccache
restore-keys: ${{ runner.os }}-cmake-${{ matrix.config.name }}-ccache
- name: Configure CMake Wallet
run: |
CC=${{ matrix.config.cc }}
CXX=${{ matrix.config.cxx }}
PYTHON=$pythonLocation/bin/python${{ matrix.config.python-version }}
if [[ ${{ matrix.config.os }} = macos* ]]; then
if [ "${{ matrix.config.no_qt }}" = "true" ]; then
export NO_QT=1
fi
if [ "${{ matrix.config.boost_root }}" = "true" ]; then
export CI_BOOST=1
if [ "${{ matrix.config.os }}" = "macos-14" ]; then
export LDFLAGS="-L/opt/homebrew/opt/boost@1.76/lib"
export CPPFLAGS="-I/opt/homebrew/opt/boost@1.76/include"
else
export CPPFLAGS="-I/usr/local/opt/boost@1.76/include -I/usr/local/opt/berkeley-db@4/include"
export LDFLAGS="-L/usr/local/opt/boost@1.76/lib -L/usr/local/opt/berkeley-db@4/lib"
fi
fi
fi
export CC
export CXX
export PYTHON
mkdir -p ${{ github.workspace }}/cmake-build-debug && cd ${{ github.workspace }}/cmake-build-debug
cmake -DCMAKE_BUILD_TYPE=Debug -G "Unix Makefiles" ${{ github.workspace }}
- name: Build CMake Wallet
run: |
cd ${{ github.workspace }}/cmake-build-debug
cmake --build ${{ github.workspace }}/cmake-build-debug --target all -- -j 2
# Autotools based build job for native linux and macOS.
# These builds use system/distro packages to satisfy dependencies.
build_native_wallet:
name: Native-${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
needs: lint
env:
APT_BASE: ccache
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_SIZE: 500M
CCACHE_COMPRESS: 1
WINEDEBUG: fixme-all
BOOST_TEST_RANDOM: 1 # random seed based on the current time
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
config:
- name: x64-Linux
id: Linux-x86_64-nodepends
os: ubuntu-20.04
python-version: '3.8'
packages: 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 libnatpmp-dev libzmq3-dev libqrencode-dev libgmp-dev libsodium-dev cargo
unit_tests: true
functional_tests: true
goal: install
BITCOIN_CONFIG: "--enable-zmq --enable-debug --with-incompatible-bdb --with-gui=qt5 CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER'"
- name: x64-Linux-latest
id: Linux-x86_64-nodepends-latest
os: ubuntu-latest
python-version: '3.8'
packages: 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 libnatpmp-dev libzmq3-dev libqrencode-dev libgmp-dev libsodium-dev cargo
unit_tests: true
functional_tests: true
goal: install
BITCOIN_CONFIG: "--enable-zmq --enable-debug --with-incompatible-bdb --with-gui=qt5 CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER'"
- name: x64-macOS
id: macOS-nodepends
os: macos-12
python-version: '3.8'
packages: autoconf automake ccache berkeley-db@4 libtool boost@1.76 miniupnpc libnatpmp pkg-config qt@5 zmq libevent qrencode gmp libsodium librsvg
unit_tests: true
functional_tests: true
cc: clang
cxx: clang++
BITCOIN_CONFIG: "--enable-zmq --enable-gui --enable-reduce-exports --enable-werror --enable-debug --with-boost=/usr/local/opt/boost@1.76"
- name: arm64-macOS-latest
id: macOS-nodepends-latest
os: macos-14
python-version: '3.10'
packages: autoconf automake ccache berkeley-db@4 libtool boost@1.76 miniupnpc libnatpmp pkg-config qt@5 zmq libevent qrencode gmp libsodium librsvg
unit_tests: true
functional_tests: true
goal: deploy
cc: clang
cxx: clang++
BITCOIN_CONFIG: "--enable-zmq --enable-gui --enable-reduce-exports --enable-werror --enable-debug --with-boost=/opt/homebrew/opt/boost@1.76"
steps:
- name: Get Source
uses: actions/checkout@v4
- name: Initialize Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config.python-version }}
- name: Setup Environment
run: |
if [[ ${{ matrix.config.os }} = ubuntu* ]]; then
sudo apt-get install --no-install-recommends --no-upgrade -qq "$APT_BASE" ${{ matrix.config.packages }}
fi
if [[ ${{ matrix.config.os }} = macos* ]]; then
brew install ${{ matrix.config.packages }}
pip install ds_store mac_alias
fi
- name: ccache cache files
uses: actions/cache@v4
with:
path: .ccache
key: ${{ runner.os }}-${{ matrix.config.id }}-native-ccache
restore-keys: ${{ runner.os }}-${{ matrix.config.id }}-native-ccache
- name: Configure Native Wallet
run: |
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
PYTHON=$pythonLocation/bin/python${{ matrix.config.python-version }}
export PYTHON
if [[ ${{ matrix.config.os }} = macos* ]]; then
CC=${{ matrix.config.cc }}
CXX=${{ matrix.config.cxx }}
export CC
export CXX
fi
if [ "${{ matrix.config.os }}" = "macos-12" ]; then
export CPPFLAGS="-I/usr/local/opt/boost@1.76/include -I/usr/local/opt/berkeley-db@4/include"
export LDFLAGS="-L/usr/local/opt/boost@1.76/lib -L/usr/local/opt/berkeley-db@4/lib"
fi
if [[ ${{ matrix.config.os }} = ubuntu* ]]; then
OUTDIR_PATH="$GITHUB_WORKSPACE/$GITHUB_RUN_NUMBER"
BITCOIN_CONFIG_ALL="--disable-dependency-tracking --prefix=$GITHUB_WORKSPACE --bindir=$OUTDIR_PATH/bin --libdir=$OUTDIR_PATH/lib"
fi
if [ "${{ matrix.config.unit_tests }}" = "true" ] || [ "${{ matrix.config.functional_tests }}" = "true" ]; then
./params/install-params.sh
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 }} || ( cat config.log && false)
echo ::endgroup
echo ::group::Distdir
make distdir VERSION=${{ matrix.config.os }}
echo ::endgroup::
cd pivx-${{ matrix.config.os }}
echo ::group::Configure
./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL ${{ matrix.config.BITCOIN_CONFIG }} || ( cat config.log && false)
echo ::endgroup
- name: Build Native Wallet
run: |
cd build/pivx-${{ matrix.config.os }}/
make -j2 ${{ matrix.config.goal }} || ( echo "Build failure. Verbose build follows." && make ${{ matrix.config.goal }} V=1 ; false )
- name: Run Unit Tests
if: matrix.config.unit_tests == true
run: |
cd build/pivx-${{ matrix.config.os }}/
make -j2 check VERBOSE=1
- name: Create Tar Archive
if: matrix.config.functional_tests == true
run: |
strip build/pivx-${{ matrix.config.os }}/src/pivxd
strip build/pivx-${{ matrix.config.os }}/src/pivx-cli
tar -hcvf native-${{ matrix.config.os }}-built.tar \
build/pivx-${{ matrix.config.os }}/share/rpcauth/ \
build/pivx-${{ matrix.config.os }}/test/ \
build/pivx-${{ matrix.config.os }}/params/ \
build/pivx-${{ matrix.config.os }}/src/pivxd \
build/pivx-${{ matrix.config.os }}/src/pivx-cli \
build/pivx-${{ matrix.config.os }}/src/test/data/asmap.raw
- name: Upload Build Artifact
if: matrix.config.functional_tests == true
uses: actions/upload-artifact@v4
with:
name: native-${{ matrix.config.os }}-built
path: native-${{ matrix.config.os }}-built.tar
retention-days: 5
# Job to run the python functional test suite for native linux and macOS builds.
# Uses a build artifact from the previous job to provide pivxd/pivx-cli and the test suite files.
test_native_wallet:
name: Native-${{ matrix.config.name }}-tests
runs-on: ${{ matrix.config.os }}
needs: build_native_wallet
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
config:
- name: x64-Linux
id: Linux-x86_64-nodepends-tests
os: ubuntu-20.04
python-version: '3.8'
packages: python3-zmq libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libqrencode-dev libgmp-dev libsodium-dev
- name: x64-Linux-latest
id: Linux-x86_64-nodepends-latest-tests
os: ubuntu-latest
python-version: '3.8'
packages: python3-zmq libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libqrencode-dev libgmp-dev libsodium-dev
- name: x64-macOS
id: macOS-nodepends
os: macos-12
python-version: '3.8'
packages: berkeley-db@4 boost@1.76 miniupnpc libnatpmp pkg-config zmq libevent qrencode gmp libsodium
- name: arm64-macOS-latest
id: macOS-nodepends-latest
os: macos-14
python-version: '3.10'
packages: berkeley-db@4 boost@1.76 miniupnpc libnatpmp pkg-config zmq libevent qrencode gmp libsodium
steps:
- name: Initialize Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.config.python-version }}
- name: Setup Environment
run: |
if [[ ${{ matrix.config.os }} = ubuntu* ]]; then
sudo apt-get install --no-install-recommends --no-upgrade -qq ${{ matrix.config.packages }}
fi
if [[ ${{ matrix.config.os }} = macos* ]]; then
brew install ${{ matrix.config.packages }}
fi
pip install pyzmq
- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
name: native-${{ matrix.config.os }}-built
- name: Extract Artifact Archive
run: tar -xvf native-${{ matrix.config.os }}-built.tar
- name: Install PIVX Params
run: |
cd build/pivx-${{ matrix.config.os }}/params/
./install-params.sh
- name: Run Functional Tests
run: |
cd build/pivx-${{ matrix.config.os }}/
test/functional/test_runner.py --combinedlogslen=4000 ${{ matrix.config.test_runner_extra }}
# Job to compile all dependencies deterministically using the depends build system.
# Results are cached for repeat use across workflow runs.
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-20.04
host: arm-linux-gnueabihf
packages: g++-arm-linux-gnueabihf
- name: AARCH64
os: ubuntu-20.04
host: aarch64-linux-gnu
packages: g++-aarch64-linux-gnu
- name: Win64
os: ubuntu-20.04
host: x86_64-w64-mingw32
packages: nsis g++-mingw-w64-x86-64 wine-binfmt wine64
- name: 32-bit + dash
os: ubuntu-20.04
host: i686-pc-linux-gnu
packages: g++-multilib python3-zmq
- name: x86_64 Linux
os: ubuntu-20.04
host: x86_64-unknown-linux-gnu
packages: python3-zmq
dep_opts: DEBUG=1
- name: macOS 10.12
os: ubuntu-20.04
host: x86_64-apple-darwin16
packages: cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools
XCODE_VERSION: 11.3.1
XCODE_BUILD_ID: 11C505
steps:
- name: Get Source
uses: actions/checkout@v4
- name: Initialize Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Setup Environment
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends --no-upgrade -qq "$APT_BASE" ${{ matrix.config.packages }}
- name: depends cache files
uses: actions/cache@v4
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: Build Depends
run: |
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
# Autotools based build job for depends based builds.
# These builds use cached depends results to satisfy dependencies.
build_depends_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: 900M
CCACHE_COMPRESS: 1
WINEDEBUG: fixme-all
BOOST_TEST_RANDOM: 1 # random seed based on the current time
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
config:
- name: ARM 32-bit [GOAL:install]
id: ARM32-build
os: ubuntu-20.04
host: arm-linux-gnueabihf
packages: 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 LDFLAGS=-static-libstdc++"
- name: AARCH64 [GOAL:install]
id: ARM64-build
os: ubuntu-20.04
host: aarch64-linux-gnu
packages: 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 LDFLAGS=-static-libstdc++"
- name: Win64 [GOAL:deploy]
id: Win64-build
os: ubuntu-20.04
host: x86_64-w64-mingw32
packages: nsis g++-mingw-w64-x86-64 wine-binfmt wine64
unit_tests: false
functional_tests: false
symbol_check: true
goal: deploy
BITCOIN_CONFIG: "--with-gui=auto --enable-reduce-exports --disable-online-rust"
- name: x86_64 Linux [GOAL:install]
id: Linux-x86_64-build
os: ubuntu-20.04
host: x86_64-unknown-linux-gnu
packages: python3-zmq
unit_tests: true
functional_tests: true
goal: install
BITCOIN_CONFIG: "--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports --disable-online-rust LDFLAGS=-static-libstdc++"
- name: macOS 10.12 [GOAL:deploy]
id: macOS10.12-build
os: ubuntu-20.04
host: x86_64-apple-darwin16
packages: cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools
XCODE_VERSION: 11.3.1
XCODE_BUILD_ID: 11C505
unit_tests: false
functional_tests: true
symbol_check: true
goal: deploy
BITCOIN_CONFIG: "--enable-gui --enable-reduce-exports --enable-werror --disable-online-rust"
steps:
- name: Get Source
uses: actions/checkout@v4
- name: Initialize Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Setup Environment
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends --no-upgrade -qq "$APT_BASE" ${{ matrix.config.packages }}
- name: depends cache files
if: matrix.config.no_depends != 1
uses: actions/cache@v4
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: ccache cache files
uses: actions/cache@v4
with:
path: .ccache
key: ${{ runner.os }}-depbuild-${{ matrix.config.id }}-ccache
restore-keys: ${{ runner.os }}-depbuilt-${{ matrix.config.id }}-ccache
- name: Configure Wallet
run: |
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
if [[ ${{ matrix.config.os }} = ubuntu* ]]; then
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"
fi
if [ "${{ matrix.config.unit_tests }}" = "true" ] || [ "${{ matrix.config.functional_tests }}" = "true" ]; then
./params/install-params.sh
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 }} || ( cat config.log && false)
echo ::endgroup::
echo ::group::Distdir
make distdir VERSION=${{ matrix.config.host }}
echo ::endgroup::
cd pivx-${{ matrix.config.host }}
echo ::group::Configure
./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL ${{ matrix.config.BITCOIN_CONFIG }} || ( cat config.log && false)
echo ::endgroup
- name: Build Wallet
run: |
cd build/pivx-${{ matrix.config.host }}/
make -j2 ${{ matrix.config.goal }} || ( echo "Build failure. Verbose build follows." && make ${{ matrix.config.goal }} V=1 ; false )
- name: Check Security
run: |
cd build/pivx-${{ matrix.config.host }}/
make -j2 -C src check-security
- name: Check Exported Symbols
if: matrix.config.symbol_check == true
run: |
cd build/pivx-${{ matrix.config.host }}/
make -j2 -C src check-symbols
- name: Run Unit Tests
if: matrix.config.unit_tests == true
run: |
cd build/pivx-${{ matrix.config.host }}
make -j2 check VERBOSE=1
- name: Create Tar Archive
if: matrix.config.functional_tests == true
run: |
if [[ ${{ matrix.config.host }} != *apple* ]]; then
strip build/pivx-${{ matrix.config.host }}/src/pivxd
strip build/pivx-${{ matrix.config.host }}/src/pivx-cli
fi
tar -hcvf ${{ matrix.config.host }}-built.tar \
build/pivx-${{ matrix.config.host }}/share/rpcauth \
build/pivx-${{ matrix.config.host }}/test/ \
build/pivx-${{ matrix.config.host }}/params/ \
build/pivx-${{ matrix.config.host }}/src/pivxd \
build/pivx-${{ matrix.config.host }}/src/pivx-cli \
build/pivx-${{ matrix.config.host }}/src/test/data/asmap.raw
- name: Upload Build Artifact
if: matrix.config.functional_tests == true
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.host }}-built
path: ${{ matrix.config.host }}-built.tar
retention-days: 5
# Job to run the python functional test suite for depends based linux builds.
# Uses a build artifact from the previous job to provide pivxd/pivx-cli and the test suite files.
test_depends_wallet:
name: Test-Depends-${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
needs: build_depends_wallet
env:
PARAMS_DIR: ${{ github.workspace }}/.pivx-params
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
config:
- name: x86_64 Linux [Full Functional Tests]
id: Linux-x86_64-tests
os: ubuntu-20.04
host: x86_64-unknown-linux-gnu
packages: python3-zmq
test_runner_extra: "--coverage --all --exclude feature_dbcrash"
- name: x86_64 Linux [Only functional tests on legacy pre-HD wallets]
id: Linux-x86_64-legacy-tests
os: ubuntu-20.04
host: x86_64-unknown-linux-gnu
packages: python3-zmq
test_runner_extra: "--legacywallet"
- name: x86_64 macOS [Full Functional Tests]
id: macos-x86_64-tests
os: macos-12
host: x86_64-apple-darwin16
packages: None
test_runner_extra: "--all --exclude feature_dbcrash"
steps:
- name: Initialize Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Setup Environment
run: |
if [[ ${{ matrix.config.packages }} != None ]]; then
if [[ ${{ matrix.config.os }} = ubuntu* ]]; then
sudo apt-get install --no-install-recommends --no-upgrade -qq ${{ matrix.config.packages }}
fi
if [[ ${{ matrix.config.os }} = macos* ]]; then
brew install ${{ matrix.config.packages }}
fi
fi
pip install pyzmq
- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.config.host }}-built
- name: Extract Artifact Archive
run: tar -xvf ${{ matrix.config.host }}-built.tar
- name: Install PIVX Params
run: |
cd build/pivx-${{ matrix.config.host }}/params/
./install-params.sh
- name: Run Functional Tests
run: |
cd build/pivx-${{ matrix.config.host }}/
if [[ ${{ matrix.config.os }} = macos* ]]; then
sed -i.old 's/home/Users/' test/config.ini
fi
test/functional/test_runner.py --combinedlogslen=4000 ${{ matrix.config.test_runner_extra }}