2024-11-02 20:32:27 +01:00
image : "ubuntu:jammy"
2019-10-16 11:48:46 +02:00
variables :
DOCKER_DRIVER : overlay2
2020-08-01 22:03:35 +02:00
FAST_MODE : "false" # when "true", only run linter on arm and unit/functional tests on linux64, skip everything else
2019-10-16 11:48:46 +02:00
2020-08-30 16:24:26 +02:00
workflow :
rules :
- when : always
2019-10-16 11:48:46 +02:00
stages :
2020-03-27 22:58:51 +01:00
- builder-image
- build-depends
2019-10-16 11:48:46 +02:00
- build
2020-03-27 22:58:51 +01:00
- test
builder-image :
stage : builder-image
2022-11-02 16:28:18 +01:00
image : docker:20.10.20
2020-03-27 22:58:51 +01:00
services :
2022-11-02 16:28:18 +01:00
- name : docker:20.10.20-dind
2022-10-31 19:08:46 +01:00
command : [ "--tls=false" ]
2020-03-27 22:58:51 +01:00
variables :
DOCKER_HOST : "tcp://docker:2375"
DOCKER_DRIVER : overlay2
DOCKER_TLS_CERTDIR : ""
2019-10-16 11:48:46 +02:00
before_script :
2020-03-27 22:58:51 +01:00
- echo $CI_JOB_TOKEN | docker login -u gitlab-ci-token --password-stdin $CI_REGISTRY
script :
2021-12-13 06:49:03 +01:00
- cd contrib/containers/ci
2020-03-27 22:58:51 +01:00
- docker pull $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG || true
- docker pull $CI_REGISTRY_IMAGE:builder-develop || true
2021-12-13 06:49:03 +01:00
- 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 .
2020-03-27 22:58:51 +01:00
- docker push $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG
.build-depends-template :
stage : build-depends
2023-06-06 10:54:29 +02:00
rules :
- when : on_success
needs :
- builder-image
2020-03-27 22:58:51 +01:00
image : $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG
variables :
SDK_URL : https://bitcoincore.org/depends-sources/sdks
2024-11-16 03:01:48 +01:00
XCODE_VERSION : "15.0"
XCODE_BUILD_ID : 15A240d
2020-03-27 22:58:51 +01:00
before_script :
- echo HOST=$HOST
2019-10-16 11:48:46 +02:00
- |
2023-06-19 15:22:31 +02:00
if [ "$HOST" = "x86_64-apple-darwin" ]; then
2020-03-27 22:58:51 +01:00
mkdir -p depends/SDKs
mkdir -p depends/sdk-sources
2021-08-26 09:46:53 +02:00
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"
2019-10-16 11:48:46 +02:00
fi
fi
2020-03-27 22:58:51 +01:00
script :
2024-03-15 20:43:01 +01:00
- make -j$(nproc) -C depends HOST=$HOST $DEP_OPTS
2020-03-27 22:58:51 +01:00
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)
2021-10-05 01:43:42 +02:00
key :
files :
2021-12-13 06:49:03 +01:00
- contrib/containers/ci/Dockerfile
2021-10-05 01:43:42 +02:00
prefix : ${CI_JOB_NAME}
2020-03-27 22:58:51 +01:00
paths :
2021-10-05 18:58:19 +02:00
- depends/built
- depends/sdk-sources
2020-03-27 22:58:51 +01:00
artifacts :
2024-12-12 11:44:18 +01:00
name : depends-${CI_JOB_NAME}
2020-03-27 22:58:51 +01:00
when : on_success
paths :
2021-10-05 18:58:19 +02:00
- depends/$HOST
- depends/SDKs
2019-10-16 11:48:46 +02:00
2020-03-27 22:58:51 +01:00
.base-template :
image : $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG
2023-06-06 10:54:29 +02:00
rules :
- when : on_success
2020-03-27 22:58:51 +01:00
before_script :
- export CACHE_DIR=$CI_PROJECT_DIR/cache
- echo BUILD_TARGET=$BUILD_TARGET
2021-12-13 08:01:14 +01:00
- source ./ci/dash/matrix.sh
2019-10-16 11:48:46 +02:00
# Setup some environment variables
2019-12-31 11:02:03 +01:00
- |
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,
2024-12-09 10:31:56 +01:00
# which allows us to use Gitlab CI for Github.
if [[ $CI_COMMIT_REF_NAME = "master" ]] || [[ $CI_COMMIT_REF_NAME = "develop" ]] || [[ $CI_COMMIT_REF_NAME =~ ^v([0-9]{1,2}\.)*x$ ]]; then
# These names are reserved for protected branches
export PULL_REQUEST="false"
else
# Everything else including experemental "feat/smth" branches must be merged via PRs, treat them as such
2019-12-31 11:02:03 +01:00
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)"
fi
fi
2019-10-16 11:48:46 +02:00
- 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
2020-03-27 22:58:51 +01:00
.build-template :
stage : build
extends : .base-template
2023-08-27 23:15:53 +02:00
variables :
CCACHE_SIZE : "400M"
2019-10-16 11:48:46 +02:00
script :
2021-12-13 08:01:14 +01:00
- ./ci/dash/build_src.sh
- ./ci/dash/test_unittests.sh # Run unit tests in build stage to avoid creating too many parallel jobs
2020-03-27 22:58:51 +01:00
cache :
# Let all branches share the same cache, which is ok because ccache is able to handle it
2021-10-05 01:43:42 +02:00
key :
files :
2021-12-13 06:49:03 +01:00
- contrib/containers/ci/Dockerfile
2021-10-05 01:43:42 +02:00
prefix : ${CI_JOB_NAME}
2020-03-27 22:58:51 +01:00
paths :
2021-10-05 18:58:19 +02:00
- cache/ccache
2020-03-27 22:58:51 +01:00
artifacts :
2024-12-12 11:44:18 +01:00
name : build-${BUILD_TARGET}
2020-03-27 22:58:51 +01:00
when : always
paths :
2021-10-05 18:58:19 +02:00
- build-ci
2021-09-18 23:30:07 +02:00
# Exclude some less important binaries to reduce the size of the artifacts
exclude :
2024-12-14 10:47:46 +01:00
- build-ci/dashcore-$BUILD_TARGET/src/**/*.a
- build-ci/dashcore-$BUILD_TARGET/src/**/*.o
2021-09-18 23:30:07 +02:00
- build-ci/dashcore-$BUILD_TARGET/src/bench/bench_dash
- build-ci/dashcore-$BUILD_TARGET/src/bench/bench_dash.exe
- build-ci/dashcore-$BUILD_TARGET/src/qt/test/test_dash-qt
- build-ci/dashcore-$BUILD_TARGET/src/qt/test/test_dash-qt.exe
- build-ci/dashcore-$BUILD_TARGET/src/test/test_dash
- build-ci/dashcore-$BUILD_TARGET/src/test/test_dash.exe
2022-03-24 21:16:55 +01:00
- build-ci/dashcore-$BUILD_TARGET/src/test/fuzz/*
2020-03-27 22:58:51 +01:00
expire_in : 3 days
2019-10-16 11:48:46 +02:00
2020-03-27 22:58:51 +01:00
.test-template :
stage : test
extends : .base-template
2020-07-14 15:12:54 +02:00
variables :
2020-07-17 01:44:20 +02:00
INTEGRATION_TESTS_ARGS : "--extended --exclude feature_pruning,feature_dbcrash"
2020-03-27 22:58:51 +01:00
script :
2020-07-14 15:12:54 +02:00
- echo "INTEGRATION_TESTS_ARGS=${INTEGRATION_TESTS_ARGS}"
2021-12-13 08:01:14 +01:00
- ./ci/dash/test_integrationtests.sh $INTEGRATION_TESTS_ARGS
2023-08-23 23:02:42 +02:00
cache :
# Let all branches share the same cache, which is ok because get_previous_releases.py extracts release binaries in separate folders
key :
files :
# CI files where $PREVIOUS_RELEASES_TO_DOWNLOAD is defined
- ci/test/00_setup_env_native_qt5.sh
prefix : ${CI_JOB_NAME}
paths :
- releases
2019-10-16 11:48:46 +02:00
after_script :
- mkdir -p $CI_PROJECT_DIR/testlogs
artifacts :
2020-03-27 22:58:51 +01:00
name : testlogs
2019-10-16 11:48:46 +02:00
when : always
paths :
2021-10-05 18:58:19 +02:00
- testlogs
2019-10-16 11:48:46 +02:00
expire_in : 3 days
2020-08-01 22:03:35 +02:00
.skip-in-fast-mode-template :
rules :
- if : '$FAST_MODE == "true"'
when : never
2023-06-06 10:54:29 +02:00
- when : on_success
2020-08-01 22:03:35 +02:00
2020-03-27 22:58:51 +01:00
###
arm-linux-gnueabihf :
extends : .build-depends-template
variables :
HOST : arm-linux-gnueabihf
x86_64-w64-mingw32 :
2020-08-01 22:03:35 +02:00
extends :
- .build-depends-template
- .skip-in-fast-mode-template
2020-03-27 22:58:51 +01:00
variables :
HOST : x86_64-w64-mingw32
2022-04-07 18:03:41 +02:00
x86_64-pc-linux-gnu-debug :
2020-03-27 22:58:51 +01:00
extends : .build-depends-template
variables :
2022-04-07 18:03:41 +02:00
HOST : x86_64-pc-linux-gnu
2020-03-27 22:58:51 +01:00
DEP_OPTS : "DEBUG=1"
2022-04-07 18:03:41 +02:00
x86_64-pc-linux-gnu-nowallet :
2020-08-01 22:03:35 +02:00
extends :
- .build-depends-template
- .skip-in-fast-mode-template
2020-05-18 14:26:53 +02:00
variables :
2022-04-07 18:03:41 +02:00
HOST : x86_64-pc-linux-gnu
2020-05-18 14:26:53 +02:00
DEP_OPTS : "NO_WALLET=1"
2024-07-13 17:35:25 +02:00
x86_64-pc-linux-gnu-multiprocess :
extends :
- .build-depends-template
- .skip-in-fast-mode-template
variables :
HOST : x86_64-pc-linux-gnu
DEP_OPTS : "MULTIPROCESS=1"
2020-05-21 09:10:52 +02:00
2023-06-19 15:22:31 +02:00
x86_64-apple-darwin :
2020-08-01 22:03:35 +02:00
extends :
- .build-depends-template
- .skip-in-fast-mode-template
2020-03-27 22:58:51 +01:00
variables :
2023-06-19 15:22:31 +02:00
HOST : x86_64-apple-darwin
2020-03-27 22:58:51 +01:00
###
arm-linux-build :
extends : .build-template
needs :
- arm-linux-gnueabihf
variables :
BUILD_TARGET : arm-linux
win64-build :
2020-08-01 22:03:35 +02:00
extends :
- .build-template
- .skip-in-fast-mode-template
2020-03-27 22:58:51 +01:00
needs :
- x86_64-w64-mingw32
variables :
BUILD_TARGET : win64
linux64-build :
extends : .build-template
needs :
2022-04-07 18:03:41 +02:00
- x86_64-pc-linux-gnu-debug
2020-03-27 22:58:51 +01:00
variables :
BUILD_TARGET : linux64
2021-12-11 23:14:17 +01:00
linux64_cxx20-build :
2023-04-14 23:56:40 +02:00
extends :
- .build-template
- .skip-in-fast-mode-template
2021-04-28 16:44:01 +02:00
needs :
2022-04-07 18:03:41 +02:00
- x86_64-pc-linux-gnu-debug
2021-04-28 16:44:01 +02:00
variables :
2021-12-11 23:14:17 +01:00
BUILD_TARGET : linux64_cxx20
2021-04-28 16:44:01 +02:00
2023-02-16 13:27:47 +01:00
linux64_sqlite-build :
2023-04-14 23:56:40 +02:00
extends :
- .build-template
- .skip-in-fast-mode-template
2023-02-16 13:27:47 +01:00
needs :
- x86_64-pc-linux-gnu-debug
variables :
BUILD_TARGET : linux64_sqlite
2022-03-17 14:51:22 +01:00
linux64_fuzz-build :
2023-04-14 23:56:40 +02:00
extends :
- .build-template
- .skip-in-fast-mode-template
2022-03-17 14:51:22 +01:00
needs :
2022-04-07 18:03:41 +02:00
- x86_64-pc-linux-gnu-debug
2022-03-17 14:51:22 +01:00
variables :
BUILD_TARGET : linux64_fuzz
2023-05-30 23:16:47 +02:00
#linux64_asan-build:
# extends:
# - .build-template
# - .skip-in-fast-mode-template
# needs:
# - x86_64-pc-linux-gnu-debug
# variables:
# BUILD_TARGET: linux64_asan
2023-05-18 13:16:04 +02:00
2022-01-10 18:31:45 +01:00
linux64_tsan-build :
extends :
- .build-template
- .skip-in-fast-mode-template
needs :
2022-04-07 18:03:41 +02:00
- x86_64-pc-linux-gnu-debug
2022-01-10 18:31:45 +01:00
variables :
BUILD_TARGET : linux64_tsan
2023-05-31 09:58:35 +02:00
linux64_ubsan-build :
extends :
- .build-template
- .skip-in-fast-mode-template
needs :
- x86_64-pc-linux-gnu-debug
variables :
BUILD_TARGET : linux64_ubsan
2020-03-27 22:58:51 +01:00
linux64_nowallet-build :
2020-08-01 22:03:35 +02:00
extends :
- .build-template
- .skip-in-fast-mode-template
2020-03-27 22:58:51 +01:00
needs :
2022-04-07 18:03:41 +02:00
- x86_64-pc-linux-gnu-nowallet
2020-03-27 22:58:51 +01:00
variables :
BUILD_TARGET : linux64_nowallet
2024-07-13 17:35:25 +02:00
linux64_multiprocess-build :
extends :
- .build-template
- .skip-in-fast-mode-template
needs :
- x86_64-pc-linux-gnu-multiprocess
variables :
BUILD_TARGET : linux64_multiprocess
2020-05-21 09:10:52 +02:00
2020-05-06 22:12:33 +02:00
#linux64_valgrind-build:
# extends:
# - .build-template
# - .skip-in-fast-mode-template
# needs:
# - x86_64-pc-linux-gnu-debug
# variables:
# BUILD_TARGET: linux64_valgrind
2019-12-17 17:46:08 +01:00
2020-03-27 22:58:51 +01:00
mac-build :
2020-08-01 22:03:35 +02:00
extends :
- .build-template
- .skip-in-fast-mode-template
2020-03-27 22:58:51 +01:00
needs :
2023-06-19 15:22:31 +02:00
- x86_64-apple-darwin
2020-03-27 22:58:51 +01:00
variables :
BUILD_TARGET : mac
###
linux64-test :
extends : .test-template
needs :
- linux64-build
variables :
BUILD_TARGET : linux64
2022-01-10 18:31:45 +01:00
2023-02-16 13:27:47 +01:00
linux64_sqlite-test :
2023-04-14 23:56:40 +02:00
extends :
- .test-template
- .skip-in-fast-mode-template
2023-02-16 13:27:47 +01:00
needs :
- linux64_sqlite-build
variables :
BUILD_TARGET : linux64_sqlite
2023-05-30 23:16:47 +02:00
#linux64_asan-test:
# extends:
# - .test-template
# - .skip-in-fast-mode-template
# needs:
# - linux64_asan-build
# variables:
# BUILD_TARGET: linux64_asan
2023-05-18 13:16:04 +02:00
2022-01-10 18:31:45 +01:00
linux64_tsan-test :
extends :
- .test-template
- .skip-in-fast-mode-template
needs :
- linux64_tsan-build
variables :
BUILD_TARGET : linux64_tsan
2023-05-31 09:58:35 +02:00
linux64_ubsan-test :
extends :
- .test-template
- .skip-in-fast-mode-template
needs :
- linux64_ubsan-build
variables :
BUILD_TARGET : linux64_ubsan
2019-12-17 17:46:08 +01:00
2024-07-13 17:35:25 +02:00
linux64_multiprocess-test :
extends :
- .test-template
- .skip-in-fast-mode-template
needs :
- linux64_multiprocess-build
variables :
BUILD_TARGET : linux64_multiprocess
2020-05-21 09:10:52 +02:00
2020-05-06 22:12:33 +02:00
#linux64_valgrind-test:
# extends:
# - .test-template
# - .skip-in-fast-mode-template
# needs:
# - linux64_valgrind-build
# variables:
# BUILD_TARGET: linux64_valgrind