Skip to content

Commit cb09d35

Browse files
2 parents 544b003 + cc55e4e commit cb09d35

15 files changed

+162
-145
lines changed

.cirrus.yml

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ container:
88
memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-containers
99
kvm: true # Use kvm to avoid spurious CI failures in the default virtualization cluster, see https://github.com/bitcoin/bitcoin/issues/20093
1010
env:
11-
PACKAGE_MANAGER_INSTALL : "apt-get update && apt-get install -y"
11+
PACKAGE_MANAGER_INSTALL: "apt-get update && apt-get install -y"
1212
MAKEJOBS: "-j4"
1313
DANGER_RUN_CI_ON_HOST: "1" # Containers will be discarded after the run, so there is no risk that the ci scripts modify the system
1414
TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache
@@ -19,6 +19,7 @@ env:
1919

2020
# https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks
2121
global_task_template: &GLOBAL_TASK_TEMPLATE
22+
skip: $CIRRUS_REPO_FULL_NAME == "bitcoin-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution
2223
ccache_cache:
2324
folder: "/tmp/ccache_dir"
2425
depends_built_cache:
@@ -28,6 +29,7 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
2829
depends_releases_cache:
2930
folder: "/tmp/cirrus-ci-build/releases"
3031
merge_base_script:
32+
- if [ "$CIRRUS_PR" = "" ]; then exit 0; fi
3133
- bash -c "$PACKAGE_MANAGER_INSTALL git"
3234
- git fetch $CIRRUS_REPO_CLONE_URL $CIRRUS_BASE_BRANCH
3335
- git config --global user.email "[email protected]"
@@ -37,6 +39,30 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
3739
- ./ci/test_run_all.sh
3840

3941

42+
task:
43+
name: 'ARM [GOAL: install] [buster] [unit tests, no functional tests]'
44+
<< : *GLOBAL_TASK_TEMPLATE
45+
container:
46+
image: debian:buster
47+
env:
48+
FILE_ENV: "./ci/test/00_setup_env_arm.sh"
49+
50+
task:
51+
name: 'Win64 [GOAL: deploy] [unit tests, no gui, no boost::process, no functional tests]'
52+
<< : *GLOBAL_TASK_TEMPLATE
53+
container:
54+
image: ubuntu:bionic
55+
env:
56+
FILE_ENV: "./ci/test/00_setup_env_win64.sh"
57+
58+
task:
59+
name: 'x86_64 Linux [GOAL: install] [focal] [previous releases, uses qt5 dev package and some depends packages] [unsigned char]'
60+
<< : *GLOBAL_TASK_TEMPLATE
61+
container:
62+
image: ubuntu:focal
63+
env:
64+
FILE_ENV: "./ci/test/00_setup_env_native_qt5.sh"
65+
4066
task:
4167
name: 'x86_64 Linux [GOAL: install] [focal] [depends, sanitizers: thread (TSan), no gui]'
4268
<< : *GLOBAL_TASK_TEMPLATE
@@ -48,6 +74,14 @@ task:
4874
MAKEJOBS: "-j8"
4975
FILE_ENV: "./ci/test/00_setup_env_native_tsan.sh"
5076

77+
task:
78+
name: 'x86_64 Linux [GOAL: install] [focal] [depends, sanitizers: memory (MSan)]'
79+
<< : *GLOBAL_TASK_TEMPLATE
80+
container:
81+
image: ubuntu:focal
82+
env:
83+
FILE_ENV: "./ci/test/00_setup_env_native_msan.sh"
84+
5185
task:
5286
name: 'x86_64 Linux [GOAL: install] [focal] [no depends, only system libs, sanitizers: address/leak (ASan + LSan) + undefined (UBSan) + integer]'
5387
<< : *GLOBAL_TASK_TEMPLATE
@@ -57,9 +91,39 @@ task:
5791
FILE_ENV: "./ci/test/00_setup_env_native_asan.sh"
5892

5993
task:
60-
name: 'x86_64 Linux [GOAL: install] [focal] [no depends, only system libs, fuzzers under valgrind]'
94+
name: 'x86_64 Linux [GOAL: install] [focal] [no depends, only system libs, sanitizers: fuzzer,address,undefined]'
95+
<< : *GLOBAL_TASK_TEMPLATE
96+
container:
97+
image: ubuntu:focal
98+
env:
99+
FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh"
100+
101+
task:
102+
name: 'x86_64 Linux [GOAL: install] [focal] [multiprocess]'
61103
<< : *GLOBAL_TASK_TEMPLATE
62104
container:
63105
image: ubuntu:focal
64106
env:
65-
FILE_ENV: "./ci/test/00_setup_env_native_fuzz_with_valgrind.sh"
107+
FILE_ENV: "./ci/test/00_setup_env_native_multiprocess.sh"
108+
109+
task:
110+
name: 'macOS 10.12 [GOAL: deploy] [no functional tests]'
111+
<< : *GLOBAL_TASK_TEMPLATE
112+
container:
113+
image: ubuntu:focal
114+
env:
115+
FILE_ENV: "./ci/test/00_setup_env_mac.sh"
116+
117+
task:
118+
name: 'macOS 10.14 native [GOAL: install] [GUI] [no depends]'
119+
macos_brew_addon_script:
120+
- brew install boost libevent berkeley-db4 qt miniupnpc ccache zeromq qrencode sqlite libtool automake pkg-config gnu-getopt
121+
<< : *GLOBAL_TASK_TEMPLATE
122+
osx_instance:
123+
# Use latest image, but hardcode version to avoid silent upgrades (and breaks)
124+
image: catalina-xcode-12.1 # https://cirrus-ci.org/guide/macOS
125+
env:
126+
DANGER_RUN_CI_ON_HOST: "true"
127+
CI_USE_APT_INSTALL: "no"
128+
PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do
129+
FILE_ENV: "./ci/test/00_setup_env_mac_host.sh"

.travis.yml

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -185,67 +185,7 @@ after_success:
185185
script:
186186
- set -o errexit; source ./ci/lint/06_script.sh
187187

188-
- stage: test
189-
name: 'ARM [GOAL: install] [focal] [unit tests, no functional tests]'
190-
arch: arm64 # Can disable QEMU_USER_CMD and run the tests natively without qemu
191-
env: >-
192-
FILE_ENV="./ci/test/00_setup_env_arm.sh"
193-
QEMU_USER_CMD=""
194-
195-
- stage: test
196-
name: 'S390x [GOAL: install] [focal] [unit tests, functional tests]'
197-
arch: s390x # Can disable QEMU_USER_CMD and run the tests natively without qemu
198-
env: >-
199-
FILE_ENV="./ci/test/00_setup_env_s390x.sh"
200-
QEMU_USER_CMD=""
201-
202-
- stage: test
203-
name: 'Win64 [GOAL: deploy] [unit tests, no gui, no boost::process, no functional tests]'
204-
env: >-
205-
FILE_ENV="./ci/test/00_setup_env_win64.sh"
206-
207-
- stage: test
208-
name: 'x86_64 Linux [GOAL: install] [focal] [previous releases, uses qt5 dev package and some depends packages] [unsigned char]'
209-
env: >-
210-
FILE_ENV="./ci/test/00_setup_env_native_qt5.sh"
211-
# x86_64 Linux (xenial, no depends, only system libs, sanitizers: thread (TSan))
212-
213-
- stage: test
214-
name: 'x86_64 Linux [GOAL: install] [focal] [no depends, only system libs, sanitizers: fuzzer,address,undefined]'
215-
env: >-
216-
FILE_ENV="./ci/test/00_setup_env_native_fuzz.sh"
217-
218-
- stage: test
219-
name: 'x86_64 Linux [GOAL: install] [focal] [multiprocess]'
220-
env: >-
221-
FILE_ENV="./ci/test/00_setup_env_native_multiprocess.sh"
222-
223188
- stage: test
224189
name: 'x86_64 Linux [GOAL: install] [focal] [no wallet]'
225190
env: >-
226191
FILE_ENV="./ci/test/00_setup_env_native_nowallet.sh"
227-
228-
- stage: test
229-
name: 'macOS 10.12 [GOAL: deploy] [no functional tests]'
230-
env: >-
231-
FILE_ENV="./ci/test/00_setup_env_mac.sh"
232-
233-
- stage: test
234-
name: 'macOS 10.14 native [GOAL: install] [GUI] [no depends]'
235-
os: osx
236-
# Use the most recent version:
237-
# Xcode 11.3.1, macOS 10.14, SDK 10.15
238-
# https://docs.travis-ci.com/user/reference/osx/#macos-version
239-
osx_image: xcode11.3
240-
addons:
241-
homebrew:
242-
packages:
243-
- berkeley-db4
244-
- miniupnpc
245-
- qrencode
246-
- ccache
247-
- zeromq
248-
env: >-
249-
DANGER_RUN_CI_ON_HOST=true
250-
CI_USE_APT_INSTALL=no
251-
FILE_ENV="./ci/test/00_setup_env_mac_host.sh"

ci/dash/test_unittests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ if [ "$DIRECT_WINE_EXEC_TESTS" = "true" ]; then
2929
wine ./src/test/test_dash.exe
3030
else
3131
if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
32-
./src/test/test_dash --catch_system_errors=no -l test_suite
32+
${TEST_RUNNER_ENV} ./src/test/test_dash --catch_system_errors=no -l test_suite
3333
else
34-
make $MAKEJOBS check VERBOSE=1
34+
${TEST_RUNNER_ENV} make $MAKEJOBS check VERBOSE=1
3535
fi
3636
fi

ci/test/00_setup_env_mac_host.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ export HOST=x86_64-apple-darwin
1111
export PIP_PACKAGES="zmq lief"
1212
export GOAL="install"
1313
export BITCOIN_CONFIG="--with-gui --enable-reduce-exports --disable-miner --enable-werror --with-boost-process"
14+
export CI_OS_NAME="macos"
1415
export NO_DEPENDS=1
1516
export OSX_SDK=""
1617
export CCACHE_SIZE=300M
1718

1819
export RUN_SECURITY_TESTS="true"
19-
if [ "$TRAVIS_REPO_SLUG" != "dashpay/dash" ]; then
20-
export RUN_FUNCTIONAL_TESTS="false"
21-
export EXPECTED_TESTS_DURATION_IN_SECONDS=200
22-
fi

ci/test/00_setup_env_s390x.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ fi
1919
# Use debian to avoid 404 apt errors
2020
export CONTAINER_NAME=ci_s390x
2121
export RUN_UNIT_TESTS=true
22+
export TEST_RUNNER_ENV="LC_ALL=C"
2223
export RUN_FUNCTIONAL_TESTS=true
2324
export GOAL="install"
2425
export BITCOIN_CONFIG="--enable-reduce-exports --disable-gui-tests --with-boost-process" # GUI tests disabled for now, see https://github.com/bitcoin/bitcoin/issues/23730

ci/test/00_setup_env_win64.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_win64
1010
export HOST=x86_64-w64-mingw32
11-
export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64"
11+
export PACKAGES="python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64 file"
1212
export DPKG_ADD_ARCH="i386"
1313
export RUN_FUNCTIONAL_TESTS=false
1414
export RUN_SECURITY_TESTS="false"

ci/test/04_install.sh

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ if [[ $QEMU_USER_CMD == qemu-s390* ]]; then
1313
export LC_ALL=C
1414
fi
1515

16-
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
17-
${CI_RETRY_EXE} pip3 install $PIP_PACKAGES
16+
if [ "$CI_OS_NAME" == "macos" ]; then
17+
IN_GETOPT_BIN="/usr/local/opt/gnu-getopt/bin/getopt" ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES
1818
fi
1919

2020
# Create folders that are mounted into the docker
@@ -26,9 +26,7 @@ export LSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/
2626
export TSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/tsan:halt_on_error=1"
2727
export UBSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1"
2828
env | grep -E '^(BASE_|QEMU_|CCACHE_|LC_ALL|BOOST_TEST_RANDOM|DEBIAN_FRONTEND|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS|PREVIOUS_RELEASES_DIR))' | tee /tmp/env
29-
if [[ $HOST = *-mingw32 ]]; then
30-
DOCKER_ADMIN="--cap-add SYS_ADMIN"
31-
elif [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764)
29+
if [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764)
3230
DOCKER_ADMIN="--cap-add SYS_PTRACE"
3331
fi
3432

@@ -72,16 +70,16 @@ elif [ "$CI_USE_APT_INSTALL" != "no" ]; then
7270
fi
7371
fi
7472

75-
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
73+
if [ "$CI_OS_NAME" == "macos" ]; then
7674
top -l 1 -s 0 | awk ' /PhysMem/ {print}'
7775
echo "Number of CPUs: $(sysctl -n hw.logicalcpu)"
7876
else
7977
DOCKER_EXEC free -m -h
8078
DOCKER_EXEC echo "Number of CPUs \(nproc\):" \$\(nproc\)
8179
DOCKER_EXEC echo $(lscpu | grep Endian)
82-
DOCKER_EXEC echo "Free disk space:"
83-
DOCKER_EXEC df -h
8480
fi
81+
DOCKER_EXEC echo "Free disk space:"
82+
DOCKER_EXEC df -h
8583

8684
if [ ! -d ${DIR_QA_ASSETS} ]; then
8785
if [ "$RUN_FUZZ_TESTS" = "true" ]; then

ci/test/05_before_script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
export LC_ALL=C.UTF-8
88

99
# Make sure default datadir does not exist and is never read by creating a dummy file
10-
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
10+
if [ "$CI_OS_NAME" == "macos" ]; then
1111
echo > $HOME/Library/Application\ Support/DashCore
1212
else
1313
DOCKER_EXEC echo \> \$HOME/.dashcore

ci/test/wrap-wine.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2020 The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
7+
export LC_ALL=C.UTF-8
8+
9+
for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/univalue/{no_nul,test_json,unitester,object}}.exe; do
10+
# shellcheck disable=SC2044
11+
for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name "$(basename $b_name)"); do
12+
if (file "$b" | grep "Windows"); then
13+
echo "Wrap $b ..."
14+
mv "$b" "${b}_orig"
15+
echo '#!/usr/bin/env bash' > "$b"
16+
echo "wine64 \"${b}_orig\" \"\$@\"" >> "$b"
17+
chmod +x "$b"
18+
fi
19+
done
20+
done

0 commit comments

Comments
 (0)