From c40a595b0cb348f1ca67b1d577b82e27ec298269 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Sat, 23 Nov 2024 14:13:49 +0300 Subject: [PATCH] ci: Drop matrix.json, align CI-s --- .github/workflows/build.yml | 66 +++++++++++++++------ .github/workflows/matrix.json | 66 --------------------- .gitlab-ci.yml | 20 ++++--- ci/test/00_setup_env_native_multiprocess.sh | 2 +- 4 files changed, 59 insertions(+), 95 deletions(-) delete mode 100644 .github/workflows/matrix.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e39b112306f18..9a0a28d11f82c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,8 +19,6 @@ jobs: outputs: image-tag: ${{ steps.prepare.outputs.image-tag }} repo-name: ${{ steps.prepare.outputs.repo-name }} - dep-matrix: ${{ steps.prepare.outputs.dep-matrix }} - src-matrix: ${{ steps.prepare.outputs.src-matrix }} steps: - name: Checkout code uses: actions/checkout@v4 @@ -34,8 +32,6 @@ jobs: REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') echo "image-tag=${BRANCH_NAME}" >> $GITHUB_OUTPUT echo "repo-name=${REPO_NAME}" >> $GITHUB_OUTPUT - echo "dep-matrix=$(jq -r '.dep' -c .github/workflows/matrix.json)" >> $GITHUB_OUTPUT - echo "src-matrix=$(jq -r '.src' -c .github/workflows/matrix.json)" >> $GITHUB_OUTPUT - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -65,7 +61,16 @@ jobs: runs-on: ubuntu-22.04 strategy: fail-fast: false - matrix: ${{ fromJson(needs.build-image.outputs.dep-matrix) }} + matrix: + include: + - 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_nowallet + build_target: linux64_nowallet container: image: ghcr.io/${{ needs.build-image.outputs.repo-name }}/dashcore-ci-runner:${{ needs.build-image.outputs.image-tag }} options: --user root @@ -87,25 +92,29 @@ jobs: - name: Determine params id: det-params run: | - dep_name="${{ matrix.depends_name }}" - dep_opts="${{ matrix.dep_opts }}" - dep_hash="$(echo -n ${dep_opts} | sha256sum | head -c 64)" - echo "\"${dep_name}\" has DEP_OPTS \"${dep_opts}\" with hash \"${dep_hash}\"" + 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 }} + 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: Build depends - run: env HOST=${{ matrix.host }} ${{ matrix.dep_opts }} make -j$(nproc) -C depends + run: env HOST=${{ steps.det-params.outputs.dep_host }} ${{ steps.det-params.outputs.dep_opts }} make -j$(nproc) -C depends build: name: ${{ matrix.build_target }} @@ -113,7 +122,26 @@ jobs: runs-on: ubuntu-22.04 strategy: fail-fast: false - matrix: ${{ fromJson(needs.build-image.outputs.src-matrix) }} + matrix: + include: + - build_target: arm-linux + depends_name: arm-linux-gnueabihf + - build_target: linux64 + depends_name: x86_64-pc-linux-gnu_debug + - build_target: linux64_cxx20 + 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 + depends_name: x86_64-pc-linux-gnu_nowallet + - build_target: linux64_sqlite + depends_name: x86_64-pc-linux-gnu_debug + - build_target: linux64_tsan + depends_name: x86_64-pc-linux-gnu_debug + - 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 @@ -126,14 +154,14 @@ jobs: - name: Determine params id: det-params run: | - dep_name="${{ matrix.depends_name }}" - dep_opts="$(jq -r ".dep.include[] | select(.depends_name == \"${{ matrix.depends_name }}\") | .dep_opts" -c .github/workflows/matrix.json)" - dep_hash="$(echo -n ${dep_opts} | sha256sum | head -c 64)" - echo "\"${dep_name}\" has DEP_OPTS \"${dep_opts}\" with hash \"${dep_hash}\"" + 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 - dep_host="$(jq -r ".dep.include[] | select(.depends_name == \"${{ matrix.depends_name }}\") | .host" -c .github/workflows/matrix.json)" - echo "\"${dep_name}\" has HOST \"${dep_host}\"" - echo "dep_host=${dep_host}" >> $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 diff --git a/.github/workflows/matrix.json b/.github/workflows/matrix.json deleted file mode 100644 index dd3cd1b4d988fc..00000000000000 --- a/.github/workflows/matrix.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "dep": { - "include": [ - { - "depends_name": "arm-linux-gnueabihf", - "host": "arm-linux-gnueabihf", - "dep_opts": "" - }, - { - "depends_name": "x86_64-pc-linux-gnu_debug", - "host": "x86_64-pc-linux-gnu", - "dep_opts": "DEBUG=1" - }, - { - "depends_name": "x86_64-pc-linux-gnu_multiprocess", - "host": "x86_64-pc-linux-gnu", - "dep_opts": "DEBUG=1 MULTIPROCESS=1 CC=clang-18 CXX=clang++-18" - }, - { - "depends_name": "x86_64-pc-linux-gnu_nowallet", - "host": "x86_64-pc-linux-gnu", - "dep_opts": "NO_WALLET=1" - } - ] - }, - "src": { - "include": [ - { - "build_target": "arm-linux", - "depends_name": "arm-linux-gnueabihf" - }, - { - "build_target": "linux64", - "depends_name": "x86_64-pc-linux-gnu_debug" - }, - { - "build_target": "linux64_cxx20", - "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", - "depends_name": "x86_64-pc-linux-gnu_nowallet" - }, - { - "build_target": "linux64_sqlite", - "depends_name": "x86_64-pc-linux-gnu_debug" - }, - { - "build_target": "linux64_tsan", - "depends_name": "x86_64-pc-linux-gnu_multiprocess" - }, - { - "build_target": "linux64_ubsan", - "depends_name": "x86_64-pc-linux-gnu_debug" - } - ] - } -} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 477d1f01a84dcf..4d362812484068 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 @@ -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 - | @@ -180,43 +185,40 @@ 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: extends: .build-depends-template variables: - HOST: x86_64-pc-linux-gnu - DEP_OPTS: "DEBUG=1" + BUILD_TARGET: linux64 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: extends: - .build-depends-template - .skip-in-fast-mode-template variables: - HOST: x86_64-pc-linux-gnu - DEP_OPTS: "DEBUG=1 MULTIPROCESS=1 CC=clang-18 CXX=clang++-18" + BUILD_TARGET: linux64_multiprocess x86_64-apple-darwin: extends: - .build-depends-template - .skip-in-fast-mode-template variables: - HOST: x86_64-apple-darwin + BUILD_TARGET: mac ### diff --git a/ci/test/00_setup_env_native_multiprocess.sh b/ci/test/00_setup_env_native_multiprocess.sh index b63f7aeb6f79a2..5b0f88f0760337 100755 --- a/ci/test/00_setup_env_native_multiprocess.sh +++ b/ci/test/00_setup_env_native_multiprocess.sh @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_multiprocess export PACKAGES="cmake python3 llvm clang" -export DEP_OPTS="DEBUG=1 MULTIPROCESS=1" +export DEP_OPTS="DEBUG=1 MULTIPROCESS=1 CC=clang-18 CXX=clang++-18" export GOAL="install" export BITCOIN_CONFIG="--with-boost-process --enable-debug CC=clang-18 CXX=clang++-18" # Use clang to avoid OOM export BITCOIND=dash-node # Used in functional tests