From 41099d0776c78cbd32c041f7a67896ac7c84e099 Mon Sep 17 00:00:00 2001 From: Soeren Peters <peters@irmb.tu-bs.de> Date: Sun, 21 May 2023 06:55:58 +0000 Subject: [PATCH] Use workflow in CI to always disable detached MR pipelines. Enable running clang build analyzer and IWYU manual. --- .gitlab-ci.yml | 52 +++++++++++++++++--------------------------------- 1 file changed, 18 insertions(+), 34 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fbfcf9a76..45e4a8d4a 100755 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,11 @@ stages: - deploy - release +workflow: + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event"' + when: never # disable detached merge request pipelines + - when: always # add all jobs to normal pipeline. This can be overwritten by the rules of the jobs. ############################################################################### ## Builds ## @@ -393,13 +398,22 @@ gpu_numerical_tests: ############################################################################### ## Code analysis ## ############################################################################### -clang_build_analyzer_clang_10: +.analyze_template: stage: analyze - only: ["schedules"] - needs: [] + rules: + - if: '$CI_PROJECT_NAMESPACE == "irmb" && $CI_COMMIT_BRANCH == "develop"' + when: always + - if: '$CI_PROJECT_NAMESPACE != "irmb"' + when: manual + allow_failure: true + + +clang_build_analyzer_clang_10: + extends: .analyze_template + before_script: - export CC=clang - export CXX=clang++ @@ -425,11 +439,7 @@ clang_build_analyzer_clang_10: ############################################################################### include_what_you_use_clang_15: - stage: analyze - - only: ["schedules"] - - needs: [] + extends: .analyze_template before_script: - export CC=clang @@ -453,23 +463,9 @@ include_what_you_use_clang_15: - make ############################################################################### -.analyze_template: - - rules: # dont create MR pipeline, run always on irmb/develop and manual in all other cases - - if: $CI_PIPELINE_SOURCE == "merge_request_event" - when: never - - if: '$CI_PROJECT_NAMESPACE == "irmb" && $CI_COMMIT_BRANCH == "develop"' - when: always - - when: manual - allow_failure: true - cppcheck: - stage: analyze - extends: .analyze_template - needs: [] - before_script: - apt-get update && apt-get install -y libpcre3-dev - chmod +x utilities/install-cppcheck.sh @@ -489,12 +485,8 @@ cppcheck: # lizard - Cyclomatic Complexity Analyzer # Ignore warnings is manually set to 191. This job will fail when new warnings are added. lizard: - stage: analyze - extends: .analyze_template - needs: [] - before_script: - lizard --version @@ -514,8 +506,6 @@ gcov_gcc: extends: .analyze_template - needs: [] - before_script: - gcovr --version - export CC=/usr/bin/gcc-11 @@ -552,14 +542,8 @@ gcov_gcc: ############################################################################### # this job also produces a compile commands json file. clang-tidy: - stage: analyze - extends: .analyze_template - needs: [] - - allow_failure: true - before_script: - run-clang-tidy-15 -h -- GitLab