277 lines
7.0 KiB
YAML
277 lines
7.0 KiB
YAML
variables:
|
|
GIT_SUBMODULE_STRATEGY: recursive
|
|
GET_SOURCES_ATTEMPTS: 10
|
|
CI_SOURCE_DIR: .
|
|
CI_BUILD_DIR: _build
|
|
CI_OUTPUT_DIR: _output
|
|
|
|
.use-clang:
|
|
variables:
|
|
CXX: clang++-14
|
|
CC: clang-14
|
|
|
|
.use-ninja:
|
|
variables:
|
|
CMAKE_GENERATOR: Ninja
|
|
before_script:
|
|
- mkdir -p ~/.ssh
|
|
- chmod 700 ~/.ssh
|
|
- eval $(ssh-agent -s)
|
|
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
|
|
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
|
|
|
|
|
|
.qmake-script:
|
|
variables:
|
|
QT_SELECT: qt5
|
|
script:
|
|
- >
|
|
if [ -f "${CI_JOB_NAME}.status" ]; then
|
|
if [ "$(cat ${CI_JOB_NAME}.status)" == "${CI_COMMIT_SHA}" ]; then
|
|
echo "=== Commit ${CI_COMMIT_SHORT_SHA} already tested with job ${CI_JOB_NAME} ==="
|
|
exit 0
|
|
fi
|
|
fi
|
|
- rm -f ${CI_JOB_NAME}.status
|
|
- mkdir -p ${CI_BUILD_DIR}
|
|
- qmake -o ${CI_BUILD_DIR}/Makefile ${QMAKE_PRO_FILE}
|
|
- make -j8 -C ${CI_BUILD_DIR}
|
|
- echo "${CI_COMMIT_SHA}" > "${CI_JOB_NAME}.status"
|
|
|
|
|
|
.cmake-script:
|
|
extends: .use-ninja
|
|
script:
|
|
- >
|
|
if [ -f "${CI_JOB_NAME}.status" ]; then
|
|
if [ "$(cat ${CI_JOB_NAME}.status)" == "${CI_COMMIT_SHA}" ]; then
|
|
echo "=== Commit ${CI_COMMIT_SHORT_SHA} already tested with job ${CI_JOB_NAME} ==="
|
|
exit 0
|
|
fi
|
|
fi
|
|
- rm -f ${CI_JOB_NAME}.status
|
|
- >
|
|
if [ -n "${CONFIGURE_CMD}" ]; then
|
|
${CONFIGURE_CMD}
|
|
else
|
|
cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CI_OUTPUT_DIR} -DCPACK_PACKAGING_INSTALL_PREFIX=/opt/ecs5 -B${CI_BUILD_DIR} -H.
|
|
fi
|
|
- >
|
|
if [ -n "${BUILD_CMD}" ]; then
|
|
${BUILD_CMD}
|
|
else
|
|
cmake --build ${CI_BUILD_DIR}
|
|
fi
|
|
- >
|
|
if [ -z "${CI_SHARED_ENVIRONMENT+x}" ]; then
|
|
if [ -n "${PACKAGE_CMD}" ]; then
|
|
${PACKAGE_CMD}
|
|
else
|
|
cmake --install ${CI_BUILD_DIR}
|
|
cmake --build ${CI_BUILD_DIR} --target package
|
|
cmake --build ${CI_BUILD_DIR} --target package_source
|
|
fi
|
|
fi
|
|
- echo "${CI_COMMIT_SHA}" > "${CI_JOB_NAME}.status"
|
|
|
|
|
|
.scheduled-test:
|
|
extends: .cmake-script
|
|
rules:
|
|
- if: $CI_PIPELINE_SOURCE == "schedule"
|
|
- if: $CI_PIPELINE_SOURCE == "web"
|
|
- if: $CI_MERGE_REQUEST_ID
|
|
when: manual
|
|
allow_failure: true
|
|
cache:
|
|
paths: ['*.status']
|
|
before_script:
|
|
- >
|
|
if [ -f "${CI_JOB_NAME}.status" ]; then
|
|
if [ "$(cat ${CI_JOB_NAME}.status)" == "${CI_COMMIT_SHA}" ]; then
|
|
echo "=== Commit ${CI_COMMIT_SHORT_SHA} already tested with job ${CI_JOB_NAME} ==="
|
|
exit 0
|
|
fi
|
|
fi
|
|
- >
|
|
if [ -n "${UPDATE_CMD}" ]; then
|
|
${UPDATE_CMD}
|
|
fi
|
|
- >
|
|
if [ -n "${INSTALL_CMD}" ]; then
|
|
${INSTALL_CMD}
|
|
fi
|
|
artifacts:
|
|
paths:
|
|
- ${CI_BUILD_DIR}/*.gz
|
|
- ${CI_BUILD_DIR}/*.xz
|
|
- ${CI_BUILD_DIR}/*.deb
|
|
- ${CI_BUILD_DIR}/*.changes
|
|
- ${CI_BUILD_DIR}/*.dsc
|
|
when: on_success
|
|
expire_in: 10 days
|
|
|
|
.scheduled-mxe:
|
|
extends: .scheduled-test
|
|
image: mxe-dev
|
|
tags: ['docker']
|
|
|
|
.scheduled-smolensk15:
|
|
extends: .scheduled-test
|
|
image: smolensk15-dev
|
|
tags: ['docker']
|
|
|
|
.scheduled-smolensk17:
|
|
extends: .scheduled-test
|
|
image: smolensk17-dev
|
|
tags: ['docker']
|
|
|
|
.scheduled-orel212:
|
|
extends: .scheduled-test
|
|
image: orel212-dev
|
|
tags: ['docker']
|
|
|
|
.scheduled-bionic:
|
|
extends: .scheduled-test
|
|
image: bionic-dev
|
|
tags: ['docker']
|
|
|
|
.scheduled-focal:
|
|
extends: .scheduled-test
|
|
image: focal-dev
|
|
tags: ['docker']
|
|
|
|
.scheduled-jammy:
|
|
extends: .scheduled-test
|
|
image: jammy-dev
|
|
tags: ['docker']
|
|
|
|
.scheduled-elbrus:
|
|
extends: .scheduled-test
|
|
tags: ['elbrus']
|
|
|
|
|
|
.check-format-sources:
|
|
extends: .use-ninja
|
|
image: focal-dev
|
|
tags: ['format']
|
|
script:
|
|
- cmake -B ${CI_BUILD_DIR} .
|
|
- cmake --build ${CI_BUILD_DIR} --target check-format-sources
|
|
|
|
.myx-cmake-format-sources-check:
|
|
extends: .use-ninja
|
|
image: focal-dev
|
|
tags: ['format']
|
|
script:
|
|
- cmake -B ${CI_BUILD_DIR} .
|
|
- cmake --build ${CI_BUILD_DIR} --target myx-cmake-format-sources-check
|
|
|
|
.format-sources-check-custom:
|
|
extends: .use-ninja
|
|
image: focal-dev
|
|
tags: ['format']
|
|
script:
|
|
- >
|
|
if [ -n "${CHECK_FORMAT_SOURCES_CMD}" ]; then
|
|
${CHECK_FORMAT_SOURCES_CMD}
|
|
fi
|
|
|
|
|
|
.qmake-analyze-pvs-studio:
|
|
image: jammy-dev
|
|
tags: ['analyze']
|
|
script:
|
|
- qmake ${QMAKE_PRO_FILE}
|
|
- bear -- make -k -j$(nproc)
|
|
- pvs-studio-analyzer analyze -a 29 -j$(nproc)
|
|
- plog-converter -a "GA:1,2,3;64:1;OP:1,2;CS:1,2" -t errorfile PVS-Studio.log
|
|
|
|
.qmake-analyze-clang-tidy:
|
|
extends: .use-clang
|
|
image: jammy-dev
|
|
tags: ['analyze']
|
|
script:
|
|
- qmake ${QMAKE_PRO_FILE}
|
|
- bear -- make -k -j$(nproc)
|
|
- run-clang-tidy-14 -checks=-*,bugprone-*,clang-analyzer-*,misc-*,modernize-*,performance-*,portability-*
|
|
|
|
.qmake-analyze-clazy:
|
|
extends: .use-clang
|
|
image: jammy-dev
|
|
tags: ['analyze']
|
|
script:
|
|
- qmake ${QMAKE_PRO_FILE}
|
|
- bear -- make -k -j$(nproc)
|
|
- find . -name "*.cpp" -print0 | xargs -0 clazy-standalone --ignore-dirs=/usr -checks=level2 -p compile_commands.json
|
|
|
|
|
|
.cmake-analyze-pvs-studio:
|
|
extends: .use-ninja
|
|
image: jammy-dev
|
|
tags: ['analyze']
|
|
script:
|
|
- >
|
|
if [ -n "${CUSTOM_ANALYZE_PVS}" ]; then
|
|
${CUSTOM_ANALYZE_PVS}
|
|
else
|
|
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B ${CI_BUILD_DIR} .
|
|
pvs-studio-analyzer analyze -a 29 -f ${CI_BUILD_DIR}/compile_commands.json -j -o ${CI_BUILD_DIR}/PVS-Studio.log
|
|
plog-converter -a "GA:1,2,3;64:1;OP:1,2;CS:1,2" -t errorfile ${CI_BUILD_DIR}/PVS-Studio.log
|
|
fi
|
|
|
|
.cmake-analyze-clang-tidy:
|
|
extends: .use-ninja
|
|
extends: .use-clang
|
|
image: jammy-dev
|
|
tags: ['analyze']
|
|
script:
|
|
- >
|
|
if [ -n "${CUSTOM_ANALYZE_CLANG_TIDY}" ]; then
|
|
${CUSTOM_ANALYZE_CLANG_TIDY}
|
|
else
|
|
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B ${CI_BUILD_DIR} .
|
|
run-clang-tidy-14 -checks=-*,bugprone-*,clang-analyzer-*,misc-*,modernize-*,performance-*,portability-* -p ${CI_BUILD_DIR}
|
|
fi
|
|
|
|
.cmake-analyze-clazy:
|
|
extends: .use-ninja
|
|
extends: .use-clang
|
|
image: jammy-dev
|
|
tags: ['analyze']
|
|
script:
|
|
- >
|
|
if [ -n "${CUSTOM_ANALYZE_CLAZY}" ]; then
|
|
${CUSTOM_ANALYZE_CLAZY}
|
|
else
|
|
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B ${CI_BUILD_DIR} .
|
|
find . -name "*.cpp" -print0 | xargs -0 clazy-standalone --ignore-dirs=/usr -checks=level2 -p ${CI_BUILD_DIR}/compile_commands.json
|
|
fi
|
|
|
|
|
|
.myx-cmake-analyze-pvs-studio:
|
|
extends: .use-ninja
|
|
image: jammy-dev
|
|
tags: ['analyze']
|
|
script:
|
|
- cmake -B ${CI_BUILD_DIR} .
|
|
- cmake --build ${CI_BUILD_DIR} --target myx-cmake-analyze-pvs-studio --parallel
|
|
|
|
.myx-cmake-analyze-clang-tidy:
|
|
extends: .use-ninja
|
|
extends: .use-clang
|
|
image: jammy-dev
|
|
tags: ['analyze']
|
|
script:
|
|
- cmake -B ${CI_BUILD_DIR} .
|
|
- cmake --build build --target myx-cmake-analyze-clang-tidy --parallel
|
|
|
|
.myx-cmake-analyze-clazy:
|
|
extends: .use-ninja
|
|
image: jammy-dev
|
|
tags: ['analyze']
|
|
script:
|
|
- cmake -B ${CI_BUILD_DIR} .
|
|
- cmake --build ${CI_BUILD_DIR} --target myx-cmake-analyze-clazy --parallel
|
|
|