Skip to content

Commit

Permalink
Merge branch 'pr_6400' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Nov 24, 2024
2 parents f9d044d + 94e37ef commit 848f0be
Show file tree
Hide file tree
Showing 16 changed files with 169 additions and 108 deletions.
97 changes: 63 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,25 @@ jobs:
cache-to: type=inline

build-depends:
name: Build Dependencies
name: ${{ matrix.depends_name }}
needs: build-image
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- build_target: arm-linux
host: arm-linux-gnueabihf
- build_target: linux64
host: x86_64-pc-linux-gnu

- depends_name: arm-linux-gnueabihf
build_target: arm-linux
- depends_name: x86_64-pc-linux-gnu_debug
build_target: linux64
- depends_name: x86_64-pc-linux-gnu_multiprocess
build_target: linux64_multiprocess
- depends_name: x86_64-pc-linux-gnu_sqlite
build_target: linux64_sqlite
- depends_name: x86_64-pc-linux-gnu_nowallet
build_target: linux64_nowallet
- depends_name: x86_64-pc-linux-gnu_tsan
build_target: linux64_tsan
container:
image: ghcr.io/${{ needs.build-image.outputs.repo-name }}/dashcore-ci-runner:${{ needs.build-image.outputs.image-tag }}
options: --user root
Expand All @@ -86,52 +93,59 @@ jobs:
restore-keys: |
depends-sources-
- name: Determine params
id: det-params
run: |
BUILD_TARGET="${{ matrix.build_target }}"
source ./ci/dash/matrix.sh
echo "dep_opts=${DEP_OPTS}" >> $GITHUB_OUTPUT
dep_hash="$(echo -n ${DEP_OPTS} | sha256sum | head -c 64)"
echo "\"${{ matrix.depends_name }}\" has DEP_OPTS \"${DEP_OPTS}\" with hash \"${dep_hash}\""
echo "dep_hash=${dep_hash}" >> $GITHUB_OUTPUT
echo "\"${{ matrix.depends_name }}\" has HOST \"${HOST}\""
echo "dep_host=${HOST}" >> $GITHUB_OUTPUT
shell: bash

- name: Cache depends
uses: actions/cache@v4
with:
path: |
depends/built
depends/${{ matrix.host }}
key: ${{ runner.os }}-depends-${{ matrix.build_target }}-${{ hashFiles('depends/packages/*') }}
depends/${{ steps.det-params.outputs.dep_host }}
key: ${{ runner.os }}-depends-${{ matrix.depends_name }}-${{ hashFiles('depends/packages/*') }}-${{ steps.det-params.outputs.dep_hash }}
restore-keys: |
${{ runner.os }}-depends-${{ matrix.build_target }}-${{ hashFiles('depends/packages/*') }}
${{ runner.os }}-depends-${{ matrix.build_target }}
${{ runner.os }}-depends-${{ matrix.depends_name }}-${{ hashFiles('depends/packages/*') }}-
${{ runner.os }}-depends-${{ matrix.depends_name }}-
- name: Build depends
run: make -j$(nproc) -C depends HOST=${{ matrix.host }}
run: env HOST=${{ steps.det-params.outputs.dep_host }} ${{ steps.det-params.outputs.dep_opts }} make -j$(nproc) -C depends

build:
name: Build
name: ${{ matrix.build_target }}
needs: [build-image, build-depends]
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- build_target: arm-linux
host: arm-linux-gnueabihf
depends_on: arm-linux
depends_name: arm-linux-gnueabihf
- build_target: linux64
host: x86_64-pc-linux-gnu
depends_on: linux64
- build_target: linux64_tsan
host: x86_64-pc-linux-gnu
depends_on: linux64
- build_target: linux64_ubsan
host: x86_64-pc-linux-gnu
depends_on: linux64
- build_target: linux64_fuzz
host: x86_64-pc-linux-gnu
depends_on: linux64
depends_name: x86_64-pc-linux-gnu_debug
- build_target: linux64_cxx20
host: x86_64-pc-linux-gnu
depends_on: linux64
- build_target: linux64_sqlite
host: x86_64-pc-linux-gnu
depends_on: linux64
depends_name: x86_64-pc-linux-gnu_debug
- build_target: linux64_fuzz
depends_name: x86_64-pc-linux-gnu_debug
- build_target: linux64_multiprocess
depends_name: x86_64-pc-linux-gnu_multiprocess
- build_target: linux64_nowallet
host: x86_64-pc-linux-gnu
depends_on: linux64
depends_name: x86_64-pc-linux-gnu_nowallet
- build_target: linux64_sqlite
depends_name: x86_64-pc-linux-gnu_sqlite
- build_target: linux64_tsan
depends_name: x86_64-pc-linux-gnu_tsan
- build_target: linux64_ubsan
depends_name: x86_64-pc-linux-gnu_debug
container:
image: ghcr.io/${{ needs.build-image.outputs.repo-name }}/dashcore-ci-runner:${{ needs.build-image.outputs.image-tag }}
options: --user root
Expand All @@ -141,13 +155,28 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Determine params
id: det-params
run: |
BUILD_TARGET="${{ matrix.build_target }}"
source ./ci/dash/matrix.sh
dep_hash="$(echo -n ${DEP_OPTS} | sha256sum | head -c 64)"
echo "\"${{ matrix.build_target }}\" has DEP_OPTS \"${DEP_OPTS}\" with hash \"${dep_hash}\""
echo "dep_hash=${dep_hash}" >> $GITHUB_OUTPUT
echo "\"${{ matrix.build_target }}\" has HOST \"${HOST}\""
echo "dep_host=${HOST}" >> $GITHUB_OUTPUT
shell: bash

- name: Restore depends cache
uses: actions/cache/restore@v4
with:
path: |
depends/built
depends/${{ matrix.host }}
key: ${{ runner.os }}-depends-${{ matrix.depends_on }}-${{ hashFiles('depends/packages/*') }}
depends/${{ steps.det-params.outputs.dep_host }}
key: ${{ runner.os }}-depends-${{ matrix.depends_name }}-${{ hashFiles('depends/packages/*') }}-${{ steps.det-params.outputs.dep_hash }}
restore-keys: |
${{ runner.os }}-depends-${{ matrix.depends_name }}-${{ hashFiles('depends/packages/*') }}-
${{ runner.os }}-depends-${{ matrix.depends_name }}-
- name: Determine PR Base SHA
id: vars
Expand Down
60 changes: 38 additions & 22 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ builder-image:
XCODE_VERSION: "15.0"
XCODE_BUILD_ID: 15A240d
before_script:
- echo BUILD_TARGET=$BUILD_TARGET
- source ./ci/dash/matrix.sh
- echo HOST=$HOST
- echo DEP_OPTS=$DEP_OPTS
- |
if [ "$HOST" = "x86_64-apple-darwin" ]; then
mkdir -p depends/SDKs
Expand Down Expand Up @@ -87,6 +90,8 @@ builder-image:
- export CACHE_DIR=$CI_PROJECT_DIR/cache
- echo BUILD_TARGET=$BUILD_TARGET
- source ./ci/dash/matrix.sh
- echo HOST=$HOST
- echo DEP_OPTS=$DEP_OPTS

# Setup some environment variables
- |
Expand Down Expand Up @@ -180,43 +185,54 @@ builder-image:
arm-linux-gnueabihf:
extends: .build-depends-template
variables:
HOST: arm-linux-gnueabihf
BUILD_TARGET: arm-linux

x86_64-w64-mingw32:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
variables:
HOST: x86_64-w64-mingw32
BUILD_TARGET: win64

x86_64-pc-linux-gnu-debug:
x86_64-pc-linux-gnu_debug:
extends: .build-depends-template
variables:
HOST: x86_64-pc-linux-gnu
DEP_OPTS: "DEBUG=1"
BUILD_TARGET: linux64

x86_64-pc-linux-gnu-nowallet:
x86_64-pc-linux-gnu_nowallet:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
variables:
HOST: x86_64-pc-linux-gnu
DEP_OPTS: "NO_WALLET=1"
BUILD_TARGET: linux64_nowallet

x86_64-pc-linux-gnu-multiprocess:
x86_64-pc-linux-gnu_sqlite:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
variables:
HOST: x86_64-pc-linux-gnu
DEP_OPTS: "MULTIPROCESS=1"
BUILD_TARGET: linux64_sqlite

x86_64-pc-linux-gnu_multiprocess:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
variables:
BUILD_TARGET: linux64_multiprocess

x86_64-pc-linux-gnu_tsan:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
variables:
BUILD_TARGET: linux64_tsan

x86_64-apple-darwin:
extends:
- .build-depends-template
- .skip-in-fast-mode-template
variables:
HOST: x86_64-apple-darwin
BUILD_TARGET: mac

###

Expand All @@ -239,7 +255,7 @@ win64-build:
linux64-build:
extends: .build-template
needs:
- x86_64-pc-linux-gnu-debug
- x86_64-pc-linux-gnu_debug
variables:
BUILD_TARGET: linux64

Expand All @@ -248,7 +264,7 @@ linux64_cxx20-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-debug
- x86_64-pc-linux-gnu_debug
variables:
BUILD_TARGET: linux64_cxx20

Expand All @@ -257,7 +273,7 @@ linux64_sqlite-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-debug
- x86_64-pc-linux-gnu_sqlite
variables:
BUILD_TARGET: linux64_sqlite

Expand All @@ -266,7 +282,7 @@ linux64_fuzz-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-debug
- x86_64-pc-linux-gnu_debug
variables:
BUILD_TARGET: linux64_fuzz

Expand All @@ -275,7 +291,7 @@ linux64_fuzz-build:
# - .build-template
# - .skip-in-fast-mode-template
# needs:
# - x86_64-pc-linux-gnu-debug
# - x86_64-pc-linux-gnu_debug
# variables:
# BUILD_TARGET: linux64_asan

Expand All @@ -284,7 +300,7 @@ linux64_tsan-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-debug
- x86_64-pc-linux-gnu_tsan
variables:
BUILD_TARGET: linux64_tsan

Expand All @@ -293,7 +309,7 @@ linux64_ubsan-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-debug
- x86_64-pc-linux-gnu_debug
variables:
BUILD_TARGET: linux64_ubsan

Expand All @@ -302,7 +318,7 @@ linux64_nowallet-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-nowallet
- x86_64-pc-linux-gnu_nowallet
variables:
BUILD_TARGET: linux64_nowallet

Expand All @@ -311,7 +327,7 @@ linux64_multiprocess-build:
- .build-template
- .skip-in-fast-mode-template
needs:
- x86_64-pc-linux-gnu-multiprocess
- x86_64-pc-linux-gnu_multiprocess
variables:
BUILD_TARGET: linux64_multiprocess

Expand All @@ -320,7 +336,7 @@ linux64_multiprocess-build:
# - .build-template
# - .skip-in-fast-mode-template
# needs:
# - x86_64-pc-linux-gnu-debug
# - x86_64-pc-linux-gnu_debug
# variables:
# BUILD_TARGET: linux64_valgrind

Expand Down
22 changes: 12 additions & 10 deletions ci/dash/matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,30 @@ export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/

if [ "$BUILD_TARGET" = "arm-linux" ]; then
source ./ci/test/00_setup_env_arm.sh
elif [ "$BUILD_TARGET" = "win64" ]; then
source ./ci/test/00_setup_env_win64.sh
elif [ "$BUILD_TARGET" = "linux64" ]; then
source ./ci/test/00_setup_env_native_qt5.sh
elif [ "$BUILD_TARGET" = "linux64_asan" ]; then
source ./ci/test/00_setup_env_native_asan.sh
elif [ "$BUILD_TARGET" = "linux64_tsan" ]; then
source ./ci/test/00_setup_env_native_tsan.sh
elif [ "$BUILD_TARGET" = "linux64_ubsan" ]; then
source ./ci/test/00_setup_env_native_ubsan.sh
elif [ "$BUILD_TARGET" = "linux64_fuzz" ]; then
source ./ci/test/00_setup_env_native_fuzz.sh
elif [ "$BUILD_TARGET" = "linux64_cxx20" ]; then
source ./ci/test/00_setup_env_native_cxx20.sh
elif [ "$BUILD_TARGET" = "linux64_sqlite" ]; then
source ./ci/test/00_setup_env_native_sqlite.sh
elif [ "$BUILD_TARGET" = "linux64_fuzz" ]; then
source ./ci/test/00_setup_env_native_fuzz.sh
elif [ "$BUILD_TARGET" = "linux64_multiprocess" ]; then
source ./ci/test/00_setup_env_native_multiprocess.sh
elif [ "$BUILD_TARGET" = "linux64_nowallet" ]; then
source ./ci/test/00_setup_env_native_nowallet.sh
elif [ "$BUILD_TARGET" = "linux64_sqlite" ]; then
source ./ci/test/00_setup_env_native_sqlite.sh
elif [ "$BUILD_TARGET" = "linux64_tsan" ]; then
source ./ci/test/00_setup_env_native_tsan.sh
elif [ "$BUILD_TARGET" = "linux64_ubsan" ]; then
source ./ci/test/00_setup_env_native_ubsan.sh
elif [ "$BUILD_TARGET" = "linux64_valgrind" ]; then
source ./ci/test/00_setup_env_native_valgrind.sh
elif [ "$BUILD_TARGET" = "mac" ]; then
source ./ci/test/00_setup_env_mac.sh
elif [ "$BUILD_TARGET" = "s390x" ]; then
source ./ci/test/00_setup_env_s390x.sh
elif [ "$BUILD_TARGET" = "win64" ]; then
source ./ci/test/00_setup_env_win64.sh
fi
2 changes: 1 addition & 1 deletion ci/dash/test_integrationtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ echo "Using socketevents mode: $SOCKETEVENTS"
EXTRA_ARGS="--dashd-arg=-socketevents=$SOCKETEVENTS"

set +e
LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib ${TEST_RUNNER_ENV} ./test/functional/test_runner.py --ci --attempts=3 --ansi --combinedlogslen=4000 --timeout-factor=${TEST_RUNNER_TIMEOUT_FACTOR} ${TEST_RUNNER_EXTRA} --failfast --nocleanup --tmpdir=$(pwd)/testdatadirs $PASS_ARGS $EXTRA_ARGS
LD_LIBRARY_PATH=$DEPENDS_DIR/$HOST/lib ./test/functional/test_runner.py --ci --attempts=3 --ansi --combinedlogslen=4000 --timeout-factor=${TEST_RUNNER_TIMEOUT_FACTOR} ${TEST_RUNNER_EXTRA} --failfast --nocleanup --tmpdir=$(pwd)/testdatadirs $PASS_ARGS $EXTRA_ARGS
RESULT=$?
set -e

Expand Down
4 changes: 2 additions & 2 deletions ci/dash/test_unittests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ if [ "$DIRECT_WINE_EXEC_TESTS" = "true" ]; then
wine ./src/test/test_dash.exe
else
if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then
${TEST_RUNNER_ENV} ./src/test/test_dash --catch_system_errors=no -l test_suite
./src/test/test_dash --catch_system_errors=no -l test_suite
else
${TEST_RUNNER_ENV} make $MAKEJOBS check VERBOSE=1
make $MAKEJOBS check VERBOSE=1
fi
fi
1 change: 0 additions & 1 deletion ci/test/00_setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export RUN_SECURITY_TESTS=${RUN_SECURITY_TESTS:-false}
# This is needed because some ci machines have slow CPU or disk, so sanitizers
# might be slow or a reindex might be waiting on disk IO.
export TEST_RUNNER_TIMEOUT_FACTOR=${TEST_RUNNER_TIMEOUT_FACTOR:-4}
export TEST_RUNNER_ENV=${TEST_RUNNER_ENV:-}
export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false}
export EXPECTED_TESTS_DURATION_IN_SECONDS=${EXPECTED_TESTS_DURATION_IN_SECONDS:-1000}

Expand Down
Loading

0 comments on commit 848f0be

Please sign in to comment.