gitlab-ci/scheduled.yml

340 lines
9.0 KiB
YAML
Raw Permalink Normal View History

2019-09-22 10:56:30 +00:00
variables:
GIT_SUBMODULE_STRATEGY: recursive
2020-04-08 14:16:50 +00:00
GET_SOURCES_ATTEMPTS: 10
2022-04-12 11:30:46 +00:00
CI_SOURCE_DIR: .
CI_BUILD_DIR: _build
CI_OUTPUT_DIR: _output
CI_CMAKE: /usr/bin/cmake
CI_QMAKE5: /usr/bin/qmake
2019-09-22 10:56:30 +00:00
2022-10-07 15:21:02 +00:00
.add-ssh-key:
before_script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- eval $(ssh-agent -s)
2022-10-09 02:12:11 +00:00
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
2022-10-07 15:21:02 +00:00
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
2022-04-14 10:14:06 +00:00
.use-clang:
variables:
CXX: clang++-14
CC: clang-14
.use-ninja:
variables:
CMAKE_GENERATOR: Ninja
2022-04-14 10:14:06 +00:00
.qmake-script:
variables:
QT_SELECT: qt5
script:
2019-09-22 10:56:30 +00:00
- >
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
2022-04-14 10:14:06 +00:00
- rm -f ${CI_JOB_NAME}.status
- mkdir -p ${CI_BUILD_DIR}
- ${CI_QMAKE} -o ${CI_BUILD_DIR}/Makefile ${QMAKE_PRO_FILE}
2022-04-14 10:14:06 +00:00
- make -j8 -C ${CI_BUILD_DIR}
- echo "${CI_COMMIT_SHA}" > "${CI_JOB_NAME}.status"
.cmake-script:
extends: .use-ninja
2019-09-22 10:56:30 +00:00
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
${CI_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
${CI_CMAKE} --build ${CI_BUILD_DIR}
fi
2020-04-08 14:16:50 +00:00
- >
if [ -z "${CI_SHARED_ENVIRONMENT+x}" ]; then
if [ -n "${PACKAGE_CMD}" ]; then
${PACKAGE_CMD}
else
${CI_CMAKE} --install ${CI_BUILD_DIR}
2023-02-17 13:50:38 +00:00
${CI_CMAKE} --build ${CI_BUILD_DIR} --target package || true
${CI_CMAKE} --build ${CI_BUILD_DIR} --target package_source || true
fi
2020-04-08 14:16:50 +00:00
fi
- echo "${CI_COMMIT_SHA}" > "${CI_JOB_NAME}.status"
2022-04-14 10:14:06 +00:00
.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
2019-09-22 10:56:30 +00:00
artifacts:
paths:
2022-04-12 11:30:46 +00:00
- ${CI_BUILD_DIR}/*.gz
- ${CI_BUILD_DIR}/*.xz
- ${CI_BUILD_DIR}/*.deb
- ${CI_BUILD_DIR}/*.changes
- ${CI_BUILD_DIR}/*.dsc
2019-09-22 10:56:30 +00:00
when: on_success
expire_in: 10 days
2022-12-02 10:47:00 +00:00
.scheduled-mxe-focal-shared-large:
variables:
CI_QMAKE: /usr/lib/mxe/usr/bin/x86_64-w64-mingw32.shared-qmake-qt5
CI_CMAKE: /usr/lib/mxe/usr/bin/x86_64-w64-mingw32.shared-cmake
CI_USE_MXE: 1
extends: .scheduled-test
before_script:
- !reference [.add-ssh-key, before_script]
image: mxe-focal-shared-large
tags: ['docker']
.scheduled-mxe-focal-static-large:
variables:
CI_QMAKE: /usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-qmake-qt5
CI_CMAKE: /usr/lib/mxe/usr/bin/x86_64-w64-mingw32.static-cmake
CI_USE_MXE: 1
2022-01-28 15:19:39 +00:00
extends: .scheduled-test
2022-10-09 02:12:11 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-12-02 10:47:00 +00:00
image: mxe-focal-static-large
2022-01-28 15:19:39 +00:00
tags: ['docker']
2019-09-22 10:56:30 +00:00
.scheduled-smolensk15:
extends: .scheduled-test
image: smolensk15-dev
tags: ['docker']
2022-10-08 14:41:23 +00:00
.scheduled-smolensk16:
extends: .scheduled-test
2022-10-09 02:12:11 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-10-08 14:41:23 +00:00
image: smolensk16-dev
tags: ['docker']
.scheduled-smolensk17:
extends: .scheduled-test
2022-10-09 02:12:11 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
image: smolensk17-dev
tags: ['docker']
2019-09-22 10:56:30 +00:00
.scheduled-orel212:
extends: .scheduled-test
2022-10-09 02:12:11 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2019-09-22 10:56:30 +00:00
image: orel212-dev
tags: ['docker']
.scheduled-bionic:
extends: .scheduled-test
2022-10-09 02:12:11 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2019-09-22 10:56:30 +00:00
image: bionic-dev
tags: ['docker']
2020-04-08 14:16:50 +00:00
.scheduled-focal:
extends: .scheduled-test
2022-10-09 02:12:11 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2020-04-08 14:16:50 +00:00
image: focal-dev
tags: ['docker']
2022-01-28 13:42:09 +00:00
.scheduled-jammy:
extends: .scheduled-test
2022-10-09 02:12:11 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-01-28 13:42:09 +00:00
image: jammy-dev
tags: ['docker']
2019-09-22 10:56:30 +00:00
.scheduled-elbrus:
extends: .scheduled-test
2022-10-09 02:12:11 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2019-09-22 10:56:30 +00:00
tags: ['elbrus']
2022-04-14 10:14:06 +00:00
.check-format-sources:
2022-04-14 10:14:06 +00:00
extends: .use-ninja
2022-10-09 19:06:12 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-10-08 14:41:23 +00:00
image: jammy-dev
tags: ['format']
script:
- ${CI_CMAKE} -B ${CI_BUILD_DIR} .
- ${CI_CMAKE} --build ${CI_BUILD_DIR} --target check-format-sources
2022-10-10 04:34:34 +00:00
.myx-uncrustify-check:
2022-04-14 10:14:06 +00:00
extends: .use-ninja
2022-10-09 19:06:12 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-10-08 14:41:23 +00:00
image: jammy-dev
tags: ['format']
script:
- ${CI_CMAKE} -B ${CI_BUILD_DIR} .
- ${CI_CMAKE} --build ${CI_BUILD_DIR} --target myx-uncrustify-check
.format-sources-check-custom:
2022-04-14 10:14:06 +00:00
extends: .use-ninja
2022-10-09 19:06:12 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-10-08 14:41:23 +00:00
image: jammy-dev
tags: ['format']
script:
- >
if [ -n "${CHECK_FORMAT_SOURCES_CMD}" ]; then
${CHECK_FORMAT_SOURCES_CMD}
fi
.qmake-analyze-pvs-studio:
2022-10-09 19:06:12 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
image: jammy-dev
tags: ['analyze']
script:
- ${CI_QMAKE} ${QMAKE_PRO_FILE}
2022-04-07 14:32:49 +00:00
- bear -- make -k -j$(nproc)
2022-04-07 14:25:44 +00:00
- 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:
2022-10-09 19:06:12 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-04-14 10:14:06 +00:00
extends: .use-clang
image: jammy-dev
tags: ['analyze']
script:
- ${CI_QMAKE} ${QMAKE_PRO_FILE}
2022-04-07 14:32:49 +00:00
- bear -- make -k -j$(nproc)
2022-04-07 14:25:44 +00:00
- run-clang-tidy-14 -checks=-*,bugprone-*,clang-analyzer-*,misc-*,modernize-*,performance-*,portability-*
.qmake-analyze-clazy:
2022-10-09 19:06:12 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-04-14 10:14:06 +00:00
extends: .use-clang
image: jammy-dev
tags: ['analyze']
script:
- ${CI_QMAKE} ${QMAKE_PRO_FILE}
2022-04-07 14:32:49 +00:00
- bear -- make -k -j$(nproc)
2022-04-07 14:25:44 +00:00
- find . -name "*.cpp" -print0 | xargs -0 clazy-standalone --ignore-dirs=/usr -checks=level2 -p compile_commands.json
.cmake-analyze-pvs-studio:
2022-10-09 19:06:12 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-04-14 10:14:06 +00:00
extends: .use-ninja
2022-04-07 07:18:59 +00:00
image: jammy-dev
tags: ['analyze']
script:
- >
if [ -n "${CUSTOM_ANALYZE_PVS}" ]; then
${CUSTOM_ANALYZE_PVS}
else
${CI_CMAKE} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B ${CI_BUILD_DIR} .
2022-04-12 12:10:15 +00:00
pvs-studio-analyzer analyze -a 29 -f ${CI_BUILD_DIR}/compile_commands.json -j -o ${CI_BUILD_DIR}/PVS-Studio.log
2022-04-12 11:56:27 +00:00
plog-converter -a "GA:1,2,3;64:1;OP:1,2;CS:1,2" -t errorfile ${CI_BUILD_DIR}/PVS-Studio.log
2022-04-07 07:18:59 +00:00
fi
.cmake-analyze-clang-tidy:
2022-10-09 19:06:12 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-04-14 10:14:06 +00:00
extends: .use-ninja
extends: .use-clang
2022-04-07 08:09:36 +00:00
image: jammy-dev
tags: ['analyze']
script:
- >
if [ -n "${CUSTOM_ANALYZE_CLANG_TIDY}" ]; then
${CUSTOM_ANALYZE_CLANG_TIDY}
else
${CI_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}
2022-04-07 08:09:36 +00:00
fi
.cmake-analyze-clazy:
2022-10-09 19:06:12 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-04-14 10:14:06 +00:00
extends: .use-ninja
extends: .use-clang
image: jammy-dev
tags: ['analyze']
script:
- >
if [ -n "${CUSTOM_ANALYZE_CLAZY}" ]; then
${CUSTOM_ANALYZE_CLAZY}
else
${CI_CMAKE} -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -B ${CI_BUILD_DIR} .
2022-04-12 11:30:46 +00:00
find . -name "*.cpp" -print0 | xargs -0 clazy-standalone --ignore-dirs=/usr -checks=level2 -p ${CI_BUILD_DIR}/compile_commands.json
fi
2022-10-10 04:34:34 +00:00
.myxx-analyze-pvs-studio:
2022-10-09 19:06:12 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-04-14 10:14:06 +00:00
extends: .use-ninja
image: jammy-dev
tags: ['analyze']
script:
- ${CI_CMAKE} -B ${CI_BUILD_DIR} .
2022-10-10 04:34:34 +00:00
- ${CI_CMAKE} --build ${CI_BUILD_DIR} --target myxx-analyze-pvs-studio --parallel
2022-10-10 04:34:34 +00:00
.myxx-analyze-clang-tidy:
2022-10-09 19:06:12 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-04-14 10:14:06 +00:00
extends: .use-ninja
extends: .use-clang
image: jammy-dev
tags: ['analyze']
script:
- ${CI_CMAKE} -B ${CI_BUILD_DIR} .
2022-10-10 04:34:34 +00:00
- ${CI_CMAKE} --build ${CI_BUILD_DIR} --target myxx-analyze-clang-tidy --parallel
2022-10-10 04:34:34 +00:00
.myxx-analyze-clazy:
2022-10-09 19:06:12 +00:00
before_script:
- !reference [.add-ssh-key, before_script]
2022-04-14 10:14:06 +00:00
extends: .use-ninja
image: jammy-dev
tags: ['analyze']
script:
- ${CI_CMAKE} -B ${CI_BUILD_DIR} .
2022-10-10 04:34:34 +00:00
- ${CI_CMAKE} --build ${CI_BUILD_DIR} --target myxx-analyze-clazy --parallel