152 lines
4.7 KiB
YAML
152 lines
4.7 KiB
YAML
variables:
|
|
GIT_STRATEGY: "clone"
|
|
BUILD_PADDING_PREFIX: /tmp/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX/
|
|
INSTALL_PREFIX: "/opt/tsg/stellar"
|
|
INSTALL_DEPENDENCY_LIBRARY: framework_env libfieldstat4-devel
|
|
|
|
stages:
|
|
- cppcheck
|
|
- build
|
|
- test
|
|
- upload
|
|
|
|
.predefined_matrix_x86_64_el8: &predefined_matrix_x86_64_el8
|
|
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_el9: &predefined_matrix_aarch64_el9
|
|
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
|
|
- mkdir -p $BUILD_PADDING_PREFIX/$CI_PROJECT_NAMESPACE/
|
|
- ln -s $CI_PROJECT_DIR $BUILD_PADDING_PREFIX/$CI_PROJECT_PATH
|
|
- cd $BUILD_PADDING_PREFIX/$CI_PROJECT_PATH
|
|
- yum makecache --disablerepo="*" --enablerepo="framework,platform"
|
|
- yum install -y $INSTALL_DEPENDENCY_LIBRARY $MRZCPD
|
|
- source /etc/profile.d/mrzcpd.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:
|
|
stage: cppcheck
|
|
parallel:
|
|
matrix:
|
|
- <<: *predefined_matrix_x86_64_el8
|
|
- <<: *predefined_matrix_aarch64_el9
|
|
image: $BUILD_IMAGE
|
|
tags:
|
|
- $TAG
|
|
script:
|
|
- mkdir build; cd build; cmake3 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
|
|
- |
|
|
cppcheck --project=compile_commands.json \
|
|
--enable=all \
|
|
--std=c++11 \
|
|
--error-exitcode=1 \
|
|
--suppress=unusedFunction \
|
|
--suppress=missingInclude \
|
|
--suppress=uselessAssignmentPtrArg \
|
|
--suppress=unmatchedSuppression \
|
|
--suppress=variableScope \
|
|
--suppress=unreadVariable \
|
|
--suppress=cstyleCast \
|
|
--suppress=memleakOnRealloc \
|
|
--suppress=constParameter \
|
|
--suppress=uselessAssignmentArg \
|
|
--suppress=uninitvar \
|
|
--suppress=unusedStructMember \
|
|
--suppress=funcArgOrderDifferent \
|
|
--suppress=unreachableCode \
|
|
--suppress=internalAstError \
|
|
--suppress=integerOverflow \
|
|
--suppress=*:${CI_PROJECT_DIR}/deps/* \
|
|
--suppress=*:${CI_PROJECT_DIR}/infra/monitor/stellar-dump/* \
|
|
--suppress=*:${CI_PROJECT_DIR}/decoders/lpi_plus/libprotoident/*
|
|
|
|
###############################################################################
|
|
# build
|
|
###############################################################################
|
|
build:
|
|
stage: build
|
|
parallel:
|
|
matrix:
|
|
- <<: *predefined_matrix_x86_64_el8
|
|
- <<: *predefined_matrix_aarch64_el9
|
|
image: $BUILD_IMAGE
|
|
tags:
|
|
- $TAG
|
|
before_script: *everything_before_script
|
|
variables:
|
|
BUILD_TYPE: "RelWithDebInfo"
|
|
ASAN_OPTION: "OFF"
|
|
script: *build_script
|
|
artifacts:
|
|
name: "artifacts-${CI_COMMIT_REF_NAME}-${TAG}-${BUILD_TYPE}"
|
|
paths:
|
|
- build/infra/*.rpm
|
|
when: on_success
|
|
###############################################################################
|
|
# test
|
|
###############################################################################
|
|
test:
|
|
stage: test
|
|
parallel:
|
|
matrix:
|
|
- <<: *predefined_matrix_x86_64_el8
|
|
- <<: *predefined_matrix_aarch64_el9
|
|
image: $BUILD_IMAGE
|
|
tags:
|
|
- $TAG
|
|
dependencies:
|
|
- build
|
|
before_script: *everything_before_script
|
|
variables:
|
|
BUILD_TYPE: "Debug"
|
|
ASAN_OPTION: "ADDRESS"
|
|
script:
|
|
- *build_script
|
|
- ctest -V
|
|
|
|
###############################################################################
|
|
# upload
|
|
###############################################################################
|
|
upload:
|
|
stage: upload
|
|
parallel:
|
|
matrix:
|
|
- <<: *predefined_matrix_x86_64_el8
|
|
- <<: *predefined_matrix_aarch64_el9
|
|
image: $BUILD_IMAGE
|
|
tags:
|
|
- $TAG
|
|
dependencies:
|
|
- build
|
|
before_script:
|
|
- pwd; ls -l ; cd build ; ls -l
|
|
- cp /root/rpm_upload_tools.py ./
|
|
script:
|
|
- python3 rpm_upload_tools.py $PULP3_REPO_NAME $PULP3_DIST_NAME *.rpm
|
|
rules:
|
|
- if: $CI_COMMIT_TAG |