🐎 ci(optimize ci stage): parallel & matrix
This commit is contained in:
337
.gitlab-ci.yml
337
.gitlab-ci.yml
@@ -3,12 +3,6 @@ variables:
|
|||||||
BUILD_PADDING_PREFIX: /tmp/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX/
|
BUILD_PADDING_PREFIX: /tmp/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX/
|
||||||
INSTALL_PREFIX: "/opt/tsg/stellar"
|
INSTALL_PREFIX: "/opt/tsg/stellar"
|
||||||
INSTALL_DEPENDENCY_LIBRARY: framework_env libfieldstat4-devel
|
INSTALL_DEPENDENCY_LIBRARY: framework_env libfieldstat4-devel
|
||||||
MRZCPD: mrzcpd-corei7
|
|
||||||
TESTING_VERSION_BUILD: 0
|
|
||||||
BUILD_IMAGE_X86_64_ROCKY8: "git.mesalab.cn:7443/mesa_platform/build-env:rocky8-for-stellar"
|
|
||||||
BUILD_IMAGE_AARCH64_ROCKY9: "git.mesalab.cn:7443/mesa_platform/build-env:rocky9-aarch64"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- cppcheck
|
- cppcheck
|
||||||
@@ -16,6 +10,22 @@ stages:
|
|||||||
- test
|
- test
|
||||||
- upload
|
- upload
|
||||||
|
|
||||||
|
.predefined_matrix_x86_64: &predefined_matrix_x86_64
|
||||||
|
TAG: "tsg-os-builder-el8"
|
||||||
|
BUILD_IMAGE: "git.mesalab.cn:7443/mesa_platform/build-env:rocky8-for-stellar"
|
||||||
|
MRZCPD: "mrzcpd-corei7"
|
||||||
|
PULP3_REPO_NAME: "stellar-stable-x86_64.el8"
|
||||||
|
PULP3_DIST_NAME: "stellar-stable-x86_64.el8"
|
||||||
|
|
||||||
|
.predefined_matrix_aarch64: &predefined_matrix_aarch64
|
||||||
|
TAG: "tsg-os-builder-aarch64"
|
||||||
|
BUILD_IMAGE: "git.mesalab.cn:7443/mesa_platform/build-env:rocky9-aarch64"
|
||||||
|
MRZCPD: "mrzcpd"
|
||||||
|
PULP3_REPO_NAME: "stellar-stable-aarch64.el9"
|
||||||
|
PULP3_DIST_NAME: "stellar-stable-aarch64.el9"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.everything_before_script: &everything_before_script
|
.everything_before_script: &everything_before_script
|
||||||
- mkdir -p $BUILD_PADDING_PREFIX/$CI_PROJECT_NAMESPACE/
|
- mkdir -p $BUILD_PADDING_PREFIX/$CI_PROJECT_NAMESPACE/
|
||||||
- ln -s $CI_PROJECT_DIR $BUILD_PADDING_PREFIX/$CI_PROJECT_PATH
|
- ln -s $CI_PROJECT_DIR $BUILD_PADDING_PREFIX/$CI_PROJECT_PATH
|
||||||
@@ -25,269 +35,118 @@ stages:
|
|||||||
- source /etc/profile.d/mrzcpd.sh
|
- source /etc/profile.d/mrzcpd.sh
|
||||||
- source /etc/profile.d/framework.sh
|
- source /etc/profile.d/framework.sh
|
||||||
|
|
||||||
|
.build_script: &build_script
|
||||||
|
- mkdir build || true
|
||||||
|
- cd build
|
||||||
|
- >
|
||||||
|
cmake3 -DCMAKE_CXX_FLAGS=$CXX_FLAGS
|
||||||
|
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
||||||
|
-DASAN_OPTION=$ASAN_OPTION
|
||||||
|
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
|
||||||
|
..
|
||||||
|
- make -j4 VERBOSE=1
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# cppcheck
|
# cppcheck
|
||||||
###############################################################################
|
###############################################################################
|
||||||
.cppcheck_script:
|
cppcheck:
|
||||||
variables:
|
|
||||||
BUILD_TYPE: Debug
|
|
||||||
stage: cppcheck
|
stage: cppcheck
|
||||||
|
parallel:
|
||||||
|
matrix:
|
||||||
|
- <<: *predefined_matrix_x86_64
|
||||||
|
- <<: *predefined_matrix_aarch64
|
||||||
|
image: $BUILD_IMAGE
|
||||||
|
tags:
|
||||||
|
- $TAG
|
||||||
script:
|
script:
|
||||||
- mkdir build; cd build; cmake3 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
|
- mkdir build; cd build; cmake3 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
|
||||||
- >
|
- |
|
||||||
cppcheck --project=compile_commands.json
|
cppcheck --project=compile_commands.json \
|
||||||
--enable=all
|
--enable=all \
|
||||||
--std=c++11
|
--std=c++11 \
|
||||||
--error-exitcode=1
|
--error-exitcode=1 \
|
||||||
--suppress=unusedFunction
|
--suppress=unusedFunction \
|
||||||
--suppress=missingInclude
|
--suppress=missingInclude \
|
||||||
--suppress=uselessAssignmentPtrArg
|
--suppress=uselessAssignmentPtrArg \
|
||||||
--suppress=unmatchedSuppression
|
--suppress=unmatchedSuppression \
|
||||||
--suppress=variableScope
|
--suppress=variableScope \
|
||||||
--suppress=unreadVariable
|
--suppress=unreadVariable \
|
||||||
--suppress=cstyleCast
|
--suppress=cstyleCast \
|
||||||
--suppress=memleakOnRealloc
|
--suppress=memleakOnRealloc \
|
||||||
--suppress=constParameter
|
--suppress=constParameter \
|
||||||
--suppress=uselessAssignmentArg
|
--suppress=uselessAssignmentArg \
|
||||||
--suppress=uninitvar
|
--suppress=uninitvar \
|
||||||
--suppress=unusedStructMember
|
--suppress=unusedStructMember \
|
||||||
--suppress=funcArgOrderDifferent
|
--suppress=funcArgOrderDifferent \
|
||||||
--suppress=unreachableCode
|
--suppress=unreachableCode \
|
||||||
--suppress=internalAstError
|
--suppress=internalAstError \
|
||||||
--suppress=integerOverflow
|
--suppress=integerOverflow \
|
||||||
--suppress=*:${CI_PROJECT_DIR}/deps/*
|
--suppress=*:${CI_PROJECT_DIR}/deps/* \
|
||||||
--suppress=*:${CI_PROJECT_DIR}/infra/monitor/stellar-dump/*
|
--suppress=*:${CI_PROJECT_DIR}/infra/monitor/stellar-dump/* \
|
||||||
--suppress=*:${CI_PROJECT_DIR}/decoders/lpi_plus/libprotoident/*
|
--suppress=*:${CI_PROJECT_DIR}/decoders/lpi_plus/libprotoident/*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
run_cppcheck_for_x86_64_rocky8:
|
|
||||||
extends: .cppcheck_script
|
|
||||||
image: $BUILD_IMAGE_X86_64_ROCKY8
|
|
||||||
tags:
|
|
||||||
- tsg-os-builder-el8
|
|
||||||
|
|
||||||
run_cppcheck_for_aarch64_rocky9:
|
|
||||||
extends: .cppcheck_script
|
|
||||||
image: $BUILD_IMAGE_AARCH64_ROCKY9
|
|
||||||
tags:
|
|
||||||
- tsg-os-builder-aarch64
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# build
|
# build
|
||||||
###############################################################################
|
###############################################################################
|
||||||
.build_before_script:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
parallel:
|
||||||
|
matrix:
|
||||||
|
- <<: *predefined_matrix_x86_64
|
||||||
|
- <<: *predefined_matrix_aarch64
|
||||||
|
image: $BUILD_IMAGE
|
||||||
|
tags:
|
||||||
|
- $TAG
|
||||||
before_script: *everything_before_script
|
before_script: *everything_before_script
|
||||||
script:
|
|
||||||
- mkdir build || true
|
|
||||||
- cd build
|
|
||||||
- >
|
|
||||||
cmake3 -DCMAKE_CXX_FLAGS=$CXX_FLAGS
|
|
||||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
|
||||||
-DASAN_OPTION=$ASAN_OPTION
|
|
||||||
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
|
|
||||||
-DVERSION_DAILY_BUILD=$TESTING_VERSION_BUILD ..
|
|
||||||
- make -j4 VERBOSE=1
|
|
||||||
|
|
||||||
.build_for_x86_64_rocky8:
|
|
||||||
image: $BUILD_IMAGE_X86_64_ROCKY8
|
|
||||||
extends: .build_before_script
|
|
||||||
tags:
|
|
||||||
- tsg-os-builder-el8
|
|
||||||
|
|
||||||
branch_build_debug_for_x86_64_rocky8:
|
|
||||||
extends: .build_for_x86_64_rocky8
|
|
||||||
variables:
|
variables:
|
||||||
BUILD_TYPE: Debug
|
BUILD_TYPE: "RelWithDebInfo"
|
||||||
except:
|
ASAN_OPTION: "OFF"
|
||||||
- /^develop-.*$/i
|
script: *build_script
|
||||||
- /^release-.*$/i
|
|
||||||
- tags
|
|
||||||
|
|
||||||
branch_build_release_for_x86_64_rocky8:
|
|
||||||
extends: .build_for_x86_64_rocky8
|
|
||||||
variables:
|
|
||||||
BUILD_TYPE: RelWithDebInfo
|
|
||||||
except:
|
|
||||||
- /^develop-.*$/i
|
|
||||||
- /^release-.*$/i
|
|
||||||
- tags
|
|
||||||
|
|
||||||
develop_build_debug_for_x86_64_rocky8:
|
|
||||||
extends: .build_for_x86_64_rocky8
|
|
||||||
variables:
|
|
||||||
TESTING_VERSION_BUILD: 1
|
|
||||||
BUILD_TYPE: Debug
|
|
||||||
#ASAN_OPTION: ADDRESS
|
|
||||||
only:
|
|
||||||
- /^develop-.*$/i
|
|
||||||
- /^release-.*$/i
|
|
||||||
|
|
||||||
develop_build_release_for_x86_64_rocky8:
|
|
||||||
extends: .build_for_x86_64_rocky8
|
|
||||||
variables:
|
|
||||||
TESTING_VERSION_BUILD: 1
|
|
||||||
BUILD_TYPE: RelWithDebInfo
|
|
||||||
#ASAN_OPTION: ADDRESS
|
|
||||||
only:
|
|
||||||
- /^develop-.*$/i
|
|
||||||
- /^release-.*$/i
|
|
||||||
|
|
||||||
release_build_debug_for_x86_64_rocky8:
|
|
||||||
extends: .build_for_x86_64_rocky8
|
|
||||||
variables:
|
|
||||||
BUILD_TYPE: Debug
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
|
|
||||||
release_build_release_for_x86_64_rocky8:
|
|
||||||
extends: .build_for_x86_64_rocky8
|
|
||||||
variables:
|
|
||||||
BUILD_TYPE: RelWithDebInfo
|
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "stellar-release_build-$CI_COMMIT_REF_NAME-release"
|
name: "build-artifacts-${CI_COMMIT_REF_NAME}-${TAG}-${BUILD_TYPE}"
|
||||||
paths:
|
paths:
|
||||||
- build/infra/*.rpm
|
- build/infra/*.rpm
|
||||||
expire_in: 1h
|
when: on_success
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
|
|
||||||
.build_for_aarch64_rocky9:
|
|
||||||
image: $BUILD_IMAGE_AARCH64_ROCKY9
|
|
||||||
extends: .build_before_script
|
|
||||||
variables:
|
|
||||||
MRZCPD: mrzcpd
|
|
||||||
tags:
|
|
||||||
- tsg-os-builder-aarch64
|
|
||||||
|
|
||||||
branch_build_debug_for_aarch64_rocky9:
|
|
||||||
extends: .build_for_aarch64_rocky9
|
|
||||||
variables:
|
|
||||||
BUILD_TYPE: Debug
|
|
||||||
except:
|
|
||||||
- /^develop-.*$/i
|
|
||||||
- /^release-.*$/i
|
|
||||||
- tags
|
|
||||||
|
|
||||||
branch_build_release_for_aarch64_rocky9:
|
|
||||||
extends: .build_for_aarch64_rocky9
|
|
||||||
variables:
|
|
||||||
BUILD_TYPE: RelWithDebInfo
|
|
||||||
except:
|
|
||||||
- /^develop-.*$/i
|
|
||||||
- /^release-.*$/i
|
|
||||||
- tags
|
|
||||||
|
|
||||||
develop_build_debug_for_aarch64_rocky9:
|
|
||||||
extends: .build_for_aarch64_rocky9
|
|
||||||
variables:
|
|
||||||
TESTING_VERSION_BUILD: 1
|
|
||||||
BUILD_TYPE: Debug
|
|
||||||
#ASAN_OPTION: ADDRESS
|
|
||||||
only:
|
|
||||||
- /^develop-.*$/i
|
|
||||||
- /^release-.*$/i
|
|
||||||
|
|
||||||
develop_build_release_for_aarch64_rocky9:
|
|
||||||
extends: .build_for_aarch64_rocky9
|
|
||||||
variables:
|
|
||||||
TESTING_VERSION_BUILD: 1
|
|
||||||
BUILD_TYPE: RelWithDebInfo
|
|
||||||
#ASAN_OPTION: ADDRESS
|
|
||||||
only:
|
|
||||||
- /^develop-.*$/i
|
|
||||||
- /^release-.*$/i
|
|
||||||
|
|
||||||
release_build_debug_for_aarch64_rocky9:
|
|
||||||
extends: .build_for_aarch64_rocky9
|
|
||||||
variables:
|
|
||||||
BUILD_TYPE: Debug
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
|
|
||||||
release_build_release_for_aarch64_rocky9:
|
|
||||||
extends: .build_for_aarch64_rocky9
|
|
||||||
variables:
|
|
||||||
BUILD_TYPE: RelWithDebInfo
|
|
||||||
artifacts:
|
|
||||||
name: "stellar-release_build-$CI_COMMIT_REF_NAME-release"
|
|
||||||
paths:
|
|
||||||
- build/infra/*.rpm
|
|
||||||
expire_in: 1h
|
|
||||||
only:
|
|
||||||
- tags
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# test
|
# test
|
||||||
###############################################################################
|
###############################################################################
|
||||||
.setup_test_env:
|
test:
|
||||||
stage: test
|
stage: test
|
||||||
allow_failure: false
|
parallel:
|
||||||
|
matrix:
|
||||||
|
- <<: *predefined_matrix_x86_64
|
||||||
|
- <<: *predefined_matrix_aarch64
|
||||||
|
image: $BUILD_IMAGE
|
||||||
|
tags:
|
||||||
|
- $TAG
|
||||||
|
dependencies:
|
||||||
|
- build
|
||||||
before_script: *everything_before_script
|
before_script: *everything_before_script
|
||||||
script:
|
|
||||||
- mkdir build || true
|
|
||||||
- cd build
|
|
||||||
- >
|
|
||||||
cmake3 -DCMAKE_CXX_FLAGS=$CXX_FLAGS
|
|
||||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE
|
|
||||||
-DASAN_OPTION=$ASAN_OPTION
|
|
||||||
-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
|
|
||||||
-DVERSION_DAILY_BUILD=$TESTING_VERSION_BUILD ..
|
|
||||||
- make -j4 VERBOSE=1
|
|
||||||
|
|
||||||
test_for_x86_64_rocky8:
|
|
||||||
extends: .setup_test_env
|
|
||||||
image: $BUILD_IMAGE_X86_64_ROCKY8
|
|
||||||
dependencies:
|
|
||||||
- branch_build_release_for_x86_64_rocky8
|
|
||||||
- develop_build_release_for_x86_64_rocky8
|
|
||||||
- release_build_release_for_x86_64_rocky8
|
|
||||||
tags:
|
|
||||||
- tsg-os-builder-el8
|
|
||||||
|
|
||||||
test_for_aarch64_rocky9:
|
|
||||||
extends: .setup_test_env
|
|
||||||
image: $BUILD_IMAGE_AARCH64_ROCKY9
|
|
||||||
variables:
|
variables:
|
||||||
MRZCPD: mrzcpd
|
BUILD_TYPE: "Debug"
|
||||||
dependencies:
|
ASAN_OPTION: "ADDRESS"
|
||||||
- branch_build_release_for_aarch64_rocky9
|
script:
|
||||||
- develop_build_release_for_aarch64_rocky9
|
- *build_script
|
||||||
- release_build_release_for_aarch64_rocky9
|
- ctest -V
|
||||||
tags:
|
|
||||||
- tsg-os-builder-aarch64
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# upload
|
# upload
|
||||||
###############################################################################
|
###############################################################################
|
||||||
.define_before_upload:
|
upload:
|
||||||
stage: upload
|
stage: upload
|
||||||
|
parallel:
|
||||||
|
matrix:
|
||||||
|
- <<: *predefined_matrix_x86_64
|
||||||
|
- <<: *predefined_matrix_aarch64
|
||||||
|
image: $BUILD_IMAGE
|
||||||
|
tags:
|
||||||
|
- $TAG
|
||||||
|
dependencies:
|
||||||
|
- build
|
||||||
before_script:
|
before_script:
|
||||||
- pwd; ls -l ; cd build ; ls -l
|
- pwd; ls -l ; cd build ; ls -l
|
||||||
- cp /root/rpm_upload_tools.py ./
|
- cp /root/rpm_upload_tools.py ./
|
||||||
script:
|
script:
|
||||||
- python3 rpm_upload_tools.py $PULP3_REPO_NAME $PULP3_DIST_NAME *.rpm
|
- python3 rpm_upload_tools.py $PULP3_REPO_NAME $PULP3_DIST_NAME *.rpm
|
||||||
only:
|
rules:
|
||||||
- tags
|
- if: $CI_COMMIT_TAG
|
||||||
|
|
||||||
rpm_upload_for_x86_64_rocky8:
|
|
||||||
extends: .define_before_upload
|
|
||||||
image: $BUILD_IMAGE_X86_64_ROCKY8
|
|
||||||
variables:
|
|
||||||
PULP3_REPO_NAME: stellar-stable-x86_64.el8
|
|
||||||
PULP3_DIST_NAME: stellar-stable-x86_64.el8
|
|
||||||
dependencies:
|
|
||||||
- release_build_release_for_x86_64_rocky8
|
|
||||||
tags:
|
|
||||||
- tsg-os-builder-el8
|
|
||||||
|
|
||||||
rpm_upload_for_aarch64_rocky9:
|
|
||||||
extends: .define_before_upload
|
|
||||||
image: $BUILD_IMAGE_AARCH64_ROCKY9
|
|
||||||
variables:
|
|
||||||
PULP3_REPO_NAME: stellar-stable-aarch64.el9
|
|
||||||
PULP3_DIST_NAME: stellar-stable-aarch64.el9
|
|
||||||
dependencies:
|
|
||||||
- release_build_release_for_aarch64_rocky9
|
|
||||||
tags:
|
|
||||||
- tsg-os-builder-aarch64
|
|
||||||
Reference in New Issue
Block a user