From 98d4e69837246c34b5a856080450b3c26c0a5532 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 23 Jan 2026 14:37:43 -0500 Subject: [PATCH 01/16] gitlab-ci: clarify names of job classification variables Name them with `CMAKE_CI_JOB_` prefixes like we do similar variables. --- .gitlab-ci.yml | 12 ++++++------ .gitlab/os-linux.yml | 2 +- .gitlab/os-macos.yml | 14 +++++++------- .gitlab/os-windows.yml | 28 ++++++++++++++-------------- .gitlab/rules.yml | 8 ++++---- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1cb5b9c3e9..282f26770b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -250,7 +250,7 @@ b:centos8-aarch64: - .run_manually variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-centos8-aarch64" - CMAKE_CI_NO_MR: "true" + CMAKE_CI_JOB_NO_MR: "true" t:debian13-ninja: extends: @@ -272,7 +272,7 @@ t:debian13-aarch64-ninja: - .run_dependent - .needs_centos8_aarch64 variables: - CMAKE_CI_NO_MR: "true" + CMAKE_CI_JOB_NO_MR: "true" t:debian13-ninja-clang: extends: @@ -1091,7 +1091,7 @@ b:macos-x86_64-ninja: - .macos_x86_64_tags - .run_manually variables: - CMAKE_CI_NO_MR: "true" + CMAKE_CI_JOB_NO_MR: "true" b:macos-arm64-ninja: extends: @@ -1132,7 +1132,7 @@ t:macos-x86_64-ninja: needs: - b:macos-x86_64-ninja variables: - CMAKE_CI_NO_MR: "true" + CMAKE_CI_JOB_NO_MR: "true" t:macos-arm64-ninja: extends: @@ -1199,7 +1199,7 @@ t:macos-x86_64-xcode: needs: - t:macos-x86_64-ninja variables: - CMAKE_CI_NO_MR: "true" + CMAKE_CI_JOB_NO_MR: "true" t:macos-arm64-xcode: extends: @@ -1245,7 +1245,7 @@ t:macos-x86_64-ninja-ub: needs: - t:macos-x86_64-ninja variables: - CMAKE_CI_NO_MR: "true" + CMAKE_CI_JOB_NO_MR: "true" t:macos-arm64-xcode-ub: extends: diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 533964df62..803b105fee 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -907,7 +907,7 @@ - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" - CMAKE_CI_NO_MR: "true" + CMAKE_CI_JOB_NO_MR: "true" .cmake_test_linux_inteloneapi_makefiles: extends: diff --git a/.gitlab/os-macos.yml b/.gitlab/os-macos.yml index 2cf32ba5c4..93cb4f5f33 100644 --- a/.gitlab/os-macos.yml +++ b/.gitlab/os-macos.yml @@ -90,7 +90,7 @@ variables: CMAKE_CONFIGURATION: macos_x86_64_xcode CMAKE_GENERATOR: Xcode - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .macos_arm64_xcode: extends: .macos @@ -98,7 +98,7 @@ variables: CMAKE_CONFIGURATION: macos_arm64_xcode CMAKE_GENERATOR: Xcode - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .macos_arm64_xcode_symlinked: extends: .macos @@ -106,7 +106,7 @@ variables: CMAKE_CONFIGURATION: macos_arm64_xcode_symlinked CMAKE_GENERATOR: Xcode - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" CMAKE_CI_IN_SYMLINK_TREE: 1 CMAKE_CI_BUILD_DIR: "real_work/work/build" @@ -116,7 +116,7 @@ variables: CMAKE_CONFIGURATION: macos_arm64_xcode_ub CMAKE_GENERATOR: Xcode - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .macos_arm64_ninja_multi: extends: .macos @@ -124,14 +124,14 @@ variables: CMAKE_CONFIGURATION: macos_arm64_ninja_multi CMAKE_GENERATOR: "Ninja Multi-Config" - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .macos_x86_64_ninja_ub: extends: .macos variables: CMAKE_CONFIGURATION: macos_x86_64_ninja_ub - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .macos_arm64_fastbuild: extends: .macos @@ -139,7 +139,7 @@ variables: CMAKE_CONFIGURATION: macos_arm64_fastbuild CMAKE_GENERATOR: FASTBuild - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" ## Tags diff --git a/.gitlab/os-windows.yml b/.gitlab/os-windows.yml index 017a8b2e21..55bc515abe 100644 --- a/.gitlab/os-windows.yml +++ b/.gitlab/os-windows.yml @@ -130,7 +130,7 @@ CMAKE_GENERATOR: "Visual Studio 18 2026" CMAKE_GENERATOR_PLATFORM: "x64" CMAKE_GENERATOR_TOOLSET: "v145,version=14.50.35717" - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .windows_vs2022_x64: extends: .windows @@ -140,7 +140,7 @@ CMAKE_GENERATOR: "Visual Studio 17 2022" CMAKE_GENERATOR_PLATFORM: "x64" CMAKE_GENERATOR_TOOLSET: "v143,version=14.44.35207" - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .windows_vs2019_x64: extends: .windows @@ -150,7 +150,7 @@ CMAKE_GENERATOR: "Visual Studio 16 2019" CMAKE_GENERATOR_PLATFORM: "x64" CMAKE_GENERATOR_TOOLSET: "v142,version=14.29.30133" - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .windows_borland: extends: .windows @@ -158,7 +158,7 @@ variables: CMAKE_GENERATOR: "Borland Makefiles" CMAKE_CI_BUILD_TYPE: Release - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .windows_borland5.5: extends: .windows_borland @@ -178,14 +178,14 @@ variables: CMAKE_GENERATOR: "Ninja" CMAKE_CI_BUILD_TYPE: Release - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .windows_ninja_multi: extends: .windows variables: CMAKE_GENERATOR: "Ninja Multi-Config" - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .windows_nmake: extends: .windows @@ -193,7 +193,7 @@ variables: CMAKE_GENERATOR: "NMake Makefiles" CMAKE_CI_BUILD_TYPE: Release - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .windows_jom: extends: .windows @@ -201,7 +201,7 @@ variables: CMAKE_GENERATOR: "NMake Makefiles JOM" CMAKE_CI_BUILD_TYPE: Release - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .windows_fastbuild: extends: .windows @@ -209,7 +209,7 @@ variables: CMAKE_GENERATOR: "FASTBuild" CMAKE_CI_BUILD_TYPE: Release - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .windows_vs2026_x64_nmake: extends: @@ -289,7 +289,7 @@ GIT_CLONE_PATH: "$CI_BUILDS_DIR\\cmake-ci-ext\\$CI_CONCURRENT_ID" CMAKE_GENERATOR: "Watcom WMake" CMAKE_CI_BUILD_TYPE: Release - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .windows_openwatcom1.9: extends: .windows_openwatcom @@ -303,7 +303,7 @@ variables: CMAKE_GENERATOR: "Ninja" CMAKE_CI_BUILD_TYPE: Release - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .windows_orangec6.73.1: extends: .windows_orangec @@ -319,7 +319,7 @@ CMAKE_GENERATOR: "Visual Studio 18 2026" CMAKE_GENERATOR_PLATFORM: "ARM64" CMAKE_GENERATOR_TOOLSET: "v145,version=14.50.35717" - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .windows_arm64_vs2022: extends: .windows @@ -329,7 +329,7 @@ CMAKE_GENERATOR: "Visual Studio 17 2022" CMAKE_GENERATOR_PLATFORM: "ARM64" CMAKE_GENERATOR_TOOLSET: "v143,version=14.44.35207" - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .mingw_osdn_io: extends: .windows @@ -338,7 +338,7 @@ # Place MinGW environment in a path without spaces. GIT_CLONE_PATH: "$CI_BUILDS_DIR\\cmake-ci-ext\\$CI_CONCURRENT_ID" CMAKE_CI_BUILD_TYPE: Debug - CMAKE_CI_NIGHTLY_IGNORE_DEPS: "true" + CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS: "true" .mingw_osdn_io_mingw_makefiles: extends: .mingw_osdn_io diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index efb7290f76..75361ed7ff 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -13,7 +13,7 @@ - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true"' when: delayed start_in: 5 minutes - - if: '($CMAKE_CI_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' + - if: '($CMAKE_CI_JOB_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' when: never - if: '$CI_MERGE_REQUEST_ID' when: manual @@ -35,7 +35,7 @@ when: never - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true"' when: on_success - - if: '($CMAKE_CI_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' + - if: '($CMAKE_CI_JOB_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' when: never - if: '$CI_MERGE_REQUEST_ID' when: on_success @@ -52,7 +52,7 @@ when: never - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY == "false")' when: never - - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_NIGHTLY_IGNORE_DEPS == "true")' + - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS == "true")' when: always - if: '$CMAKE_CI_NIGHTLY == "true"' when: on_success @@ -60,7 +60,7 @@ when: never - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true"' when: on_success - - if: '($CMAKE_CI_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' + - if: '($CMAKE_CI_JOB_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' when: never - if: '$CI_MERGE_REQUEST_ID' when: on_success From 1a0b63f051b09f72469f0278f68df57abfe79af1 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 7 Oct 2025 22:01:58 -0400 Subject: [PATCH 02/16] gitlab-ci: add a workflow This controls the pipeline's existence, so job rules do not need to consider anything like a project-specific guard. --- .gitlab/rules.yml | 46 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index 75361ed7ff..0bdfdac3a8 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -1,5 +1,35 @@ # Rules for where jobs can run +# When to even consider running a pipeline. +workflow: + rules: + # Run for merge requests. + - if: '$CI_MERGE_REQUEST_ID' + when: always + auto_cancel: + # Cancel all pipeline jobs if a new commit comes in on the branch/tag. + on_new_commit: interruptible + # If this is not a MR, do not run for other projects. + - if: '$CI_PROJECT_PATH != "cmake/cmake" && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == null && $CMAKE_CI_PROJECT_MAIN_BRANCH == null' + when: never + # Run for schedules. + - if: '$CI_PIPELINE_SOURCE == "schedule"' + when: always + auto_cancel: + # Never cancel scheduled pipelines because of new commits. + on_new_commit: none + # Run for protected branches. + - if: '$CI_COMMIT_REF_PROTECTED == "true"' + when: always + auto_cancel: + # Cancel all pipeline jobs if a new commit comes in on the branch. + on_new_commit: interruptible + # Run for tags. + - if: '$CI_COMMIT_TAG' + when: always + # Skip pipelines in all other cases. + - when: never + .run_manually: rules: - if: '$CMAKE_CI_PACKAGE != null || $CMAKE_CI_VERSION_UPDATE != null' @@ -17,11 +47,9 @@ when: never - if: '$CI_MERGE_REQUEST_ID' when: manual - - if: '$CI_PROJECT_PATH == "cmake/cmake" && $CI_PIPELINE_SOURCE == "schedule"' + - if: '$CI_PIPELINE_SOURCE == "schedule"' when: on_success - - if: '$CI_PROJECT_PATH == "cmake/cmake"' - when: manual - - when: never + - when: manual .run_automatically: rules: @@ -39,12 +67,10 @@ when: never - if: '$CI_MERGE_REQUEST_ID' when: on_success - - if: '$CI_PROJECT_PATH == "cmake/cmake" && $CI_PIPELINE_SOURCE == "schedule"' + - if: '$CI_PIPELINE_SOURCE == "schedule"' when: on_success - - if: '$CI_PROJECT_PATH == "cmake/cmake"' - when: delayed + - when: delayed start_in: 5 minutes - - when: never .run_dependent: rules: @@ -64,9 +90,7 @@ when: never - if: '$CI_MERGE_REQUEST_ID' when: on_success - - if: '$CI_PROJECT_PATH == "cmake/cmake"' - when: on_success - - when: never + - when: on_success .run_only_for_package: rules: From 5ab50c876256731d2a63c1d6557cf7e7199d5e5a Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 7 Oct 2025 22:11:26 -0400 Subject: [PATCH 03/16] gitlab-ci: port version update pipeline logic to the single rules block Additionally mark the version update job as never running on MRs because it has side effects. Co-authored-by: Brad King --- .gitlab-ci.yml | 5 ++++- .gitlab/rules.yml | 30 ++++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 282f26770b..a9239c92cc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -79,7 +79,10 @@ b:version-update: extends: - .cmake_version_update_linux - .linux_x86_64_tags - - .run_version_update + - .rules + variables: + CMAKE_CI_JOB_UPDATES_VERSION: "true" + CMAKE_CI_JOB_NO_MR: "true" # Documentation builds diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index 0bdfdac3a8..d6d08e8388 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -1,5 +1,16 @@ # Rules for where jobs can run +### +## Job variables: +## CMAKE_CI_JOB_UPDATES_VERSION +## Set to "true" if the job performs a task that occurs with version +## updates. +## Pipeline variables: +## CMAKE_CI_VERSION_UPDATE +## Set to "true" if the pipeline should perform version update tasks. +## No other tasks are performed if set. +#### + # When to even consider running a pipeline. workflow: rules: @@ -30,6 +41,19 @@ workflow: # Skip pipelines in all other cases. - when: never +.rules: + rules: + ### Version update pipelines. + # Version update pipelines run version update jobs automatically. + - if: '$CMAKE_CI_VERSION_UPDATE == "true" && $CMAKE_CI_JOB_UPDATES_VERSION == "true"' + when: on_success + # Version update pipelines run no other jobs. + - if: '$CMAKE_CI_VERSION_UPDATE != null' + when: never + # Version update jobs do not run in any other situations. + - if: '$CMAKE_CI_JOB_UPDATES_VERSION == "true"' + when: never + .run_manually: rules: - if: '$CMAKE_CI_PACKAGE != null || $CMAKE_CI_VERSION_UPDATE != null' @@ -133,9 +157,3 @@ workflow: CMAKE_CI_VERSION_NO_GIT: "OFF" when: on_success - when: never - -.run_version_update: - rules: - - if: '$CMAKE_CI_VERSION_UPDATE != null' - when: on_success - - when: never From d1492e4dcf5c5b8d3a49b6087647bd60c6ac66fd Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 7 Oct 2025 22:39:57 -0400 Subject: [PATCH 04/16] gitlab-ci: port "website help" jobs to the single rules block These jobs run in packaging pipelines, development documentation pipelines, and continuous pipelines. Additionally mark the jobs as never running on MRs because they have side effects. Co-authored-by: Brad King --- .gitlab-ci.yml | 10 ++++++-- .gitlab/rules.yml | 63 +++++++++++++++++++++++++++++------------------ 2 files changed, 47 insertions(+), 26 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a9239c92cc..b536ec2730 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -89,13 +89,19 @@ b:version-update: b:cmake.org-help: extends: - .cmake_org_help - - .run_cmake_org_help + - .rules + variables: + CMAKE_CI_JOB_UPDATES_WEBSITE_HELP: "true" + CMAKE_CI_JOB_NO_MR: "true" needs: [] u:cmake.org-help: extends: - .rsync_upload_help - - .run_cmake_org_help + - .rules + variables: + CMAKE_CI_JOB_UPDATES_WEBSITE_HELP: "true" + CMAKE_CI_JOB_NO_MR: "true" needs: - b:cmake.org-help diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index d6d08e8388..2ccce84c22 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -5,10 +5,18 @@ ## CMAKE_CI_JOB_UPDATES_VERSION ## Set to "true" if the job performs a task that occurs with version ## updates. +## CMAKE_CI_JOB_UPDATES_WEBSITE_HELP +## Set to "true" if the job performs tasks to update website help. ## Pipeline variables: ## CMAKE_CI_VERSION_UPDATE ## Set to "true" if the pipeline should perform version update tasks. ## No other tasks are performed if set. +## Project variables: +## CMAKE_CI_PROJECT_MAIN_BRANCH +## Set to the name of the main integration branch where development +## version documentation pipelines run. +## CMAKE_CI_PROJECT_CONTINUOUS_BRANCH +## Set to the name of the staging branch where continuous pipelines run. #### # When to even consider running a pipeline. @@ -54,6 +62,37 @@ workflow: - if: '$CMAKE_CI_JOB_UPDATES_VERSION == "true"' when: never + ### Website help update jobs run in a variety of pipeline kinds. + # Packaging pipelines upload release version documentation to the website upon request. + - if: '$CMAKE_CI_PACKAGE =~ /v[0-9]+\.[0-9]+/ && $CMAKE_CI_JOB_UPDATES_WEBSITE_HELP == "true"' + variables: + RSYNC_DESTINATION: "kitware@cmake.org:$CMAKE_CI_PACKAGE/" + CMAKE_CI_SPHINX_QTHELP: "ON" + CMAKE_CI_VERSION_NO_GIT: "ON" + when: manual + # Development documentation pipelines upload documentation to the website automatically. + - if: '$CMAKE_CI_PROJECT_MAIN_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_MAIN_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_UPDATES_WEBSITE_HELP == "true"' + variables: + RSYNC_DESTINATION: "kitware@cmake.org:git-master/" + CMAKE_CI_SPHINX_QTHELP: "OFF" + CMAKE_CI_VERSION_NO_GIT: "OFF" + when: on_success + # Continuous pipelines upload staging branch documentation to the website automatically. + - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_UPDATES_WEBSITE_HELP == "true"' + variables: + RSYNC_DESTINATION: "kitware@cmake.org:git-stage/" + CMAKE_CI_SPHINX_QTHELP: "OFF" + CMAKE_CI_VERSION_NO_GIT: "OFF" + when: on_success + # Website help update jobs do not run in any other situations. + - if: '$CMAKE_CI_JOB_UPDATES_WEBSITE_HELP == "true"' + when: never + + ### Development documentation pipelines. + # Development documentation pipelines run no other jobs. + - if: '$CMAKE_CI_PROJECT_MAIN_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_MAIN_BRANCH == $CI_COMMIT_BRANCH' + when: never + .run_manually: rules: - if: '$CMAKE_CI_PACKAGE != null || $CMAKE_CI_VERSION_UPDATE != null' @@ -133,27 +172,3 @@ workflow: RSYNC_DESTINATION: "$CMAKE_CI_PACKAGE_URL" when: on_success - when: never - -.run_cmake_org_help: - rules: - - if: '$CMAKE_CI_VERSION_UPDATE != null' - when: never - - if: '$CMAKE_CI_PACKAGE =~ /v[0-9]+\.[0-9]+/' - variables: - RSYNC_DESTINATION: "kitware@cmake.org:$CMAKE_CI_PACKAGE/" - CMAKE_CI_SPHINX_QTHELP: "ON" - CMAKE_CI_VERSION_NO_GIT: "ON" - when: manual - - if: '$CMAKE_CI_PROJECT_MAIN_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_MAIN_BRANCH == $CI_COMMIT_BRANCH' - variables: - RSYNC_DESTINATION: "kitware@cmake.org:git-master/" - CMAKE_CI_SPHINX_QTHELP: "OFF" - CMAKE_CI_VERSION_NO_GIT: "OFF" - when: on_success - - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH' - variables: - RSYNC_DESTINATION: "kitware@cmake.org:git-stage/" - CMAKE_CI_SPHINX_QTHELP: "OFF" - CMAKE_CI_VERSION_NO_GIT: "OFF" - when: on_success - - when: never From 7f760a7947992e68f366d5a69170fcff274a7a0a Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 7 Oct 2025 23:34:48 -0400 Subject: [PATCH 05/16] gitlab-ci: port package pipeline logic to the single rules block Additionally mark the `u:` upload jobs as never running on MRs because they have side effects. Co-authored-by: Brad King --- .gitlab-ci.yml | 101 ++++++++++++++++++++++++++++++++++------------ .gitlab/rules.yml | 51 ++++++++++++++--------- 2 files changed, 108 insertions(+), 44 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b536ec2730..269c32ad9d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,9 +56,10 @@ p:source-package: - .cmake_prep_source_linux - .linux_x86_64_tags - .cmake_release_artifacts - - .run_only_for_package + - .rules variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-source" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" p:doc-package: extends: @@ -66,12 +67,17 @@ p:doc-package: - .cmake_prep_doc_linux - .linux_x86_64_tags - .cmake_doc_artifacts - - .run_only_for_package + - .rules + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" u:source-package: extends: - .rsync_upload_package - - .run_only_for_package + - .rules + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" + CMAKE_CI_JOB_NO_MR: "true" needs: - p:source-package @@ -980,16 +986,20 @@ b:linux-x86_64-package: - .cmake_build_linux_release - .cmake_release_artifacts - .linux_x86_64_tags - - .run_only_for_package + - .rules needs: - p:doc-package variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-linux-x86_64" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" u:linux-x86_64-package: extends: - .rsync_upload_package - - .run_only_for_package + - .rules + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" + CMAKE_CI_JOB_NO_MR: "true" needs: - b:linux-x86_64-package @@ -1000,16 +1010,20 @@ b:linux-aarch64-package: - .cmake_build_linux_release - .cmake_release_artifacts - .linux_aarch64_tags - - .run_only_for_package + - .rules needs: - p:doc-package variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-linux-aarch64" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" u:linux-aarch64-package: extends: - .rsync_upload_package - - .run_only_for_package + - .rules + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" + CMAKE_CI_JOB_NO_MR: "true" needs: - b:linux-aarch64-package @@ -1020,16 +1034,20 @@ b:sunos-x86_64-package: - .cmake_build_sunos_release - .cmake_release_artifacts - .linux_x86_64_tags - - .run_only_for_package + - .rules needs: - p:doc-package variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-sunos-x86_64" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" u:sunos-x86_64-package: extends: - .rsync_upload_package - - .run_only_for_package + - .rules + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" + CMAKE_CI_JOB_NO_MR: "true" needs: - b:sunos-x86_64-package @@ -1040,16 +1058,20 @@ b:sunos-sparc64-package: - .cmake_build_sunos_release - .cmake_release_artifacts - .linux_x86_64_tags - - .run_only_for_package + - .rules needs: - p:doc-package variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-sunos-sparc64" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" u:sunos-sparc64-package: extends: - .rsync_upload_package - - .run_only_for_package + - .rules + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" + CMAKE_CI_JOB_NO_MR: "true" needs: - b:sunos-sparc64-package @@ -1274,9 +1296,11 @@ b:macos-package: - .cmake_build_macos - .cmake_release_artifacts - .macos_arm64_tags_package - - .run_only_for_package + - .rules needs: - p:doc-package + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" k:macos-package: extends: @@ -1284,16 +1308,20 @@ k:macos-package: - .cmake_sign_macos - .cmake_release_artifacts - .macos_sign_tags - - .run_only_for_package + - .rules needs: - b:macos-package variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-macos-universal" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" u:macos-package: extends: - .rsync_upload_package - - .run_only_for_package + - .rules + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" + CMAKE_CI_JOB_NO_MR: "true" needs: - k:macos-package @@ -1303,9 +1331,11 @@ b:macos10.10-package: - .cmake_build_macos - .cmake_release_artifacts - .macos_arm64_tags_package - - .run_only_for_package + - .rules needs: - p:doc-package + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" k:macos10.10-package: extends: @@ -1313,16 +1343,20 @@ k:macos10.10-package: - .cmake_sign_macos - .cmake_release_artifacts - .macos_sign_tags - - .run_only_for_package + - .rules needs: - b:macos10.10-package variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-macos10.10-universal" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" u:macos10.10-package: extends: - .rsync_upload_package - - .run_only_for_package + - .rules + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" + CMAKE_CI_JOB_NO_MR: "true" needs: - k:macos10.10-package @@ -1682,11 +1716,12 @@ b:windows-x86_64-package: - .cmake_build_windows - .cmake_build_package_artifacts - .windows_x86_64_tags_nonconcurrent_vs2026 - - .run_only_for_package + - .rules needs: - p:doc-package variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-x86_64-build" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" k:windows-x86_64-package: extends: @@ -1694,16 +1729,20 @@ k:windows-x86_64-package: - .cmake_package_windows - .cmake_release_artifacts - .windows_x86_64_tags_nonconcurrent_sign - - .run_only_for_package + - .rules needs: - b:windows-x86_64-package variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-x86_64" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" u:windows-x86_64-package: extends: - .rsync_upload_package - - .run_only_for_package + - .rules + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" + CMAKE_CI_JOB_NO_MR: "true" needs: - k:windows-x86_64-package @@ -1713,11 +1752,12 @@ b:windows-i386-package: - .cmake_build_windows - .cmake_build_package_artifacts - .windows_x86_64_tags_nonconcurrent_vs2026 - - .run_only_for_package + - .rules needs: - p:doc-package variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-i386-build" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" k:windows-i386-package: extends: @@ -1725,16 +1765,20 @@ k:windows-i386-package: - .cmake_package_windows - .cmake_release_artifacts - .windows_x86_64_tags_nonconcurrent_sign - - .run_only_for_package + - .rules needs: - b:windows-i386-package variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-i386" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" u:windows-i386-package: extends: - .rsync_upload_package - - .run_only_for_package + - .rules + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" + CMAKE_CI_JOB_NO_MR: "true" needs: - k:windows-i386-package @@ -1744,11 +1788,12 @@ b:windows-arm64-package: - .cmake_build_windows - .cmake_build_package_artifacts - .windows_x86_64_tags_nonconcurrent_vs2026_arm64 - - .run_only_for_package + - .rules needs: - p:doc-package variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-arm64-build" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" k:windows-arm64-package: extends: @@ -1756,15 +1801,19 @@ k:windows-arm64-package: - .cmake_package_windows - .cmake_release_artifacts - .windows_x86_64_tags_nonconcurrent_sign - - .run_only_for_package + - .rules needs: - b:windows-arm64-package variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-windows-arm64" + CMAKE_CI_JOB_PACKAGE_ONLY: "true" u:windows-arm64-package: extends: - .rsync_upload_package - - .run_only_for_package + - .rules + variables: + CMAKE_CI_JOB_PACKAGE_ONLY: "true" + CMAKE_CI_JOB_NO_MR: "true" needs: - k:windows-arm64-package diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index 2ccce84c22..f38c4e4184 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -7,10 +7,17 @@ ## updates. ## CMAKE_CI_JOB_UPDATES_WEBSITE_HELP ## Set to "true" if the job performs tasks to update website help. +## CMAKE_CI_JOB_PACKAGE_ONLY +## Set to "true" if the job handles packaging tasks. These jobs will only +## run during packaging pipelines. ## Pipeline variables: ## CMAKE_CI_VERSION_UPDATE ## Set to "true" if the pipeline should perform version update tasks. ## No other tasks are performed if set. +## CMAKE_CI_PACKAGE +## Set to either "dev" or `vX.Y` to construct a packaging pipeline. Also +## uploads constructed packages. May also run website help jobs. No other +## tasks are performed if set. ## Project variables: ## CMAKE_CI_PROJECT_MAIN_BRANCH ## Set to the name of the main integration branch where development @@ -88,6 +95,32 @@ workflow: - if: '$CMAKE_CI_JOB_UPDATES_WEBSITE_HELP == "true"' when: never + ### Packaging pipelines. + # Packaging pipelines build development version packages automatically. + - if: '$CMAKE_CI_PACKAGE == "dev" && $CMAKE_CI_JOB_PACKAGE_ONLY == "true" && $CI_JOB_STAGE != "upload"' + when: on_success + # Packaging pipelines upload development version packages to the website automatically. + - if: '$CMAKE_CI_PACKAGE == "dev" && $CMAKE_CI_JOB_PACKAGE_ONLY == "true" && $CI_JOB_STAGE == "upload"' + variables: + RSYNC_DESTINATION: "kitware@cmake.org:dev/" + when: on_success + # Packaging pipelines build release version packages upon request. + - if: '$CMAKE_CI_PACKAGE != null && $CMAKE_CI_JOB_PACKAGE_ONLY == "true" && $CI_JOB_STAGE == "prep"' + when: manual + - if: '$CMAKE_CI_PACKAGE != null && $CMAKE_CI_JOB_PACKAGE_ONLY == "true" && $CI_JOB_STAGE != "upload"' + when: on_success + # Packaging pipelines upload release version packages to a staging area. + - if: '$CMAKE_CI_PACKAGE != null && $CMAKE_CI_JOB_PACKAGE_ONLY == "true" && $CI_JOB_STAGE == "upload" && $CMAKE_CI_PACKAGE_URL != null' + variables: + RSYNC_DESTINATION: "$CMAKE_CI_PACKAGE_URL" + when: on_success + # Packaging pipelines run no other jobs. + - if: '$CMAKE_CI_PACKAGE != null' + when: never + # Package-only jobs do not run in any other situations. + - if: '$CMAKE_CI_JOB_PACKAGE_ONLY == "true"' + when: never + ### Development documentation pipelines. # Development documentation pipelines run no other jobs. - if: '$CMAKE_CI_PROJECT_MAIN_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_MAIN_BRANCH == $CI_COMMIT_BRANCH' @@ -154,21 +187,3 @@ workflow: - if: '$CI_MERGE_REQUEST_ID' when: on_success - when: on_success - -.run_only_for_package: - rules: - - if: '$CMAKE_CI_PACKAGE == "dev" && $CI_JOB_STAGE != "upload"' - when: on_success - - if: '$CMAKE_CI_PACKAGE == "dev" && $CI_JOB_STAGE == "upload"' - variables: - RSYNC_DESTINATION: "kitware@cmake.org:dev/" - when: on_success - - if: '$CMAKE_CI_PACKAGE != null && $CI_JOB_STAGE == "prep"' - when: manual - - if: '$CMAKE_CI_PACKAGE != null && $CI_JOB_STAGE != "upload"' - when: on_success - - if: '$CMAKE_CI_PACKAGE != null && $CI_JOB_STAGE == "upload" && $CMAKE_CI_PACKAGE_URL != null' - variables: - RSYNC_DESTINATION: "$CMAKE_CI_PACKAGE_URL" - when: on_success - - when: never From 08500a937b31a9a8d1f3a9d95b8f1f4022bdfb6b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Tue, 7 Oct 2025 22:02:36 -0400 Subject: [PATCH 06/16] gitlab-ci: update guidance for the rules selection --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 269c32ad9d..cb05bc5dd6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -31,7 +31,9 @@ variables: # - a "base image" # - a build script # - tags for the jobs -# - rules for when to run the job +# - the `.rules` block +# - see `.gitlab/rules.yml` for variables jobs may set to control when the +# job is executed # # Additionally, jobs may also contain: # From 58a27ba28cb043cc7bf7c4b92cbb93ffc396f42b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 15 Jan 2026 21:54:13 -0500 Subject: [PATCH 07/16] gitlab-ci: remove handled conditions from remaining rules blocks This breaks the "every commit works incrementally" pattern because the remaining rules blocks are very intertwined. So instead, it ports conditions as a group to make it easier to review. --- .gitlab/rules.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index f38c4e4184..dec8c862d7 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -128,8 +128,6 @@ workflow: .run_manually: rules: - - if: '$CMAKE_CI_PACKAGE != null || $CMAKE_CI_VERSION_UPDATE != null' - when: never - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY == "false")' when: never - if: '$CMAKE_CI_NIGHTLY == "true"' @@ -149,8 +147,6 @@ workflow: .run_automatically: rules: - - if: '$CMAKE_CI_PACKAGE != null || $CMAKE_CI_VERSION_UPDATE != null' - when: never - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY == "false")' when: never - if: '$CMAKE_CI_NIGHTLY == "true"' @@ -170,8 +166,6 @@ workflow: .run_dependent: rules: - - if: '$CMAKE_CI_PACKAGE != null || $CMAKE_CI_VERSION_UPDATE != null' - when: never - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY == "false")' when: never - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS == "true")' From 69e51ad4f6fea931993fe9863705d2b25712eb1b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 15 Jan 2026 21:51:29 -0500 Subject: [PATCH 08/16] gitlab-ci: port nightly pipeline logic to the single rules block Co-authored-by: Brad King --- .gitlab/rules.yml | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index dec8c862d7..af122f27cd 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -10,6 +10,13 @@ ## CMAKE_CI_JOB_PACKAGE_ONLY ## Set to "true" if the job handles packaging tasks. These jobs will only ## run during packaging pipelines. +## CMAKE_CI_JOB_NIGHTLY +## Set to "true" if the job should only run for nightly pipelines. Set to +## "false" to suppress the job for nightly pipelines. +## CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS +## Set to "true" if the job should run even if dependent jobs fail (e.g., +## further testing of the same setup under a different generator. Should +## only be used on jobs with `needs` on other jobs. ## Pipeline variables: ## CMAKE_CI_VERSION_UPDATE ## Set to "true" if the pipeline should perform version update tasks. @@ -18,6 +25,8 @@ ## Set to either "dev" or `vX.Y` to construct a packaging pipeline. Also ## uploads constructed packages. May also run website help jobs. No other ## tasks are performed if set. +## CMAKE_CI_NIGHTLY +## Set to "true" to enable nightly-only jobs. ## Project variables: ## CMAKE_CI_PROJECT_MAIN_BRANCH ## Set to the name of the main integration branch where development @@ -126,14 +135,22 @@ workflow: - if: '$CMAKE_CI_PROJECT_MAIN_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_MAIN_BRANCH == $CI_COMMIT_BRANCH' when: never -.run_manually: - rules: - - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY == "false")' + ### Nightly pipelines. + # Nightly pipelines do not run jobs that are explicitly excluded. + - if: '$CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY == "false"' when: never + # Nightly pipelines always run jobs that ignore their dependencies. + - if: '$CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS == "true"' + when: always + # Nightly pipelines run all other jobs automatically when ready. - if: '$CMAKE_CI_NIGHTLY == "true"' when: on_success + # Nightly-only jobs do not run in any other situations. - if: '$CMAKE_CI_JOB_NIGHTLY == "true"' when: never + +.run_manually: + rules: - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true"' when: delayed start_in: 5 minutes @@ -147,12 +164,6 @@ workflow: .run_automatically: rules: - - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY == "false")' - when: never - - if: '$CMAKE_CI_NIGHTLY == "true"' - when: on_success - - if: '$CMAKE_CI_JOB_NIGHTLY == "true"' - when: never - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true"' when: on_success - if: '($CMAKE_CI_JOB_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' @@ -166,14 +177,6 @@ workflow: .run_dependent: rules: - - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY == "false")' - when: never - - if: '($CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY_IGNORE_DEPS == "true")' - when: always - - if: '$CMAKE_CI_NIGHTLY == "true"' - when: on_success - - if: '$CMAKE_CI_JOB_NIGHTLY == "true"' - when: never - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true"' when: on_success - if: '($CMAKE_CI_JOB_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' From d42be92245ce7f6c36a7c868127bbaa381c6ff07 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 15 Jan 2026 21:53:52 -0500 Subject: [PATCH 09/16] gitlab-ci: port continuous pipeline logic to the single rules block Co-authored-by: Brad King --- .gitlab/rules.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index af122f27cd..776dfdfce6 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -17,6 +17,9 @@ ## Set to "true" if the job should run even if dependent jobs fail (e.g., ## further testing of the same setup under a different generator. Should ## only be used on jobs with `needs` on other jobs. +## CMAKE_CI_JOB_RUN_MANUALLY +## Set to "true" if the job should be manually triggered in MRs. +## These jobs will also be delayed for branch update pipelines. ## Pipeline variables: ## CMAKE_CI_VERSION_UPDATE ## Set to "true" if the pipeline should perform version update tasks. @@ -135,6 +138,18 @@ workflow: - if: '$CMAKE_CI_PROJECT_MAIN_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_MAIN_BRANCH == $CI_COMMIT_BRANCH' when: never + ### Continuous pipelines. + # Continuous pipelines run manual jobs automatically after 5 minutes. + - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true" && $CMAKE_CI_JOB_RUN_MANUALLY == "true"' + when: delayed + start_in: 5 minutes + # Continuous pipelines run other jobs automatically. + - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true"' + when: on_success + # Continuous pipelines run no other jobs. + - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH' + when: never + ### Nightly pipelines. # Nightly pipelines do not run jobs that are explicitly excluded. - if: '$CMAKE_CI_NIGHTLY == "true" && $CMAKE_CI_JOB_NIGHTLY == "false"' @@ -151,9 +166,6 @@ workflow: .run_manually: rules: - - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true"' - when: delayed - start_in: 5 minutes - if: '($CMAKE_CI_JOB_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' when: never - if: '$CI_MERGE_REQUEST_ID' @@ -164,8 +176,6 @@ workflow: .run_automatically: rules: - - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true"' - when: on_success - if: '($CMAKE_CI_JOB_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' when: never - if: '$CI_MERGE_REQUEST_ID' @@ -177,8 +187,6 @@ workflow: .run_dependent: rules: - - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true"' - when: on_success - if: '($CMAKE_CI_JOB_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' when: never - if: '$CI_MERGE_REQUEST_ID' From e02d63207293283d8cd4727719fc9bb7f4c9123e Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 15 Jan 2026 21:54:44 -0500 Subject: [PATCH 10/16] gitlab-ci: port merge request pipeline logic to the single rules block Co-authored-by: Brad King --- .gitlab/rules.yml | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index 776dfdfce6..ed990922ef 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -7,6 +7,10 @@ ## updates. ## CMAKE_CI_JOB_UPDATES_WEBSITE_HELP ## Set to "true" if the job performs tasks to update website help. +## CMAKE_CI_JOB_NO_MR +## Set to "true" if the job should never run for merge requests. +## These jobs require secrets that MR pipelines cannot provide +## (software license information, upload secrets, etc.). ## CMAKE_CI_JOB_PACKAGE_ONLY ## Set to "true" if the job handles packaging tasks. These jobs will only ## run during packaging pipelines. @@ -164,22 +168,25 @@ workflow: - if: '$CMAKE_CI_JOB_NIGHTLY == "true"' when: never + ### Merge request pipelines. + # Merge request pipelines do not run jobs that are explicitly excluded. + - if: '$CI_MERGE_REQUEST_ID && $CMAKE_CI_JOB_NO_MR == "true"' + when: never + # Merge request pipelines run manual jobs upon request. + - if: '$CI_MERGE_REQUEST_ID && $CMAKE_CI_JOB_RUN_MANUALLY == "true"' + when: manual + # Merge request pipelines run other jobs automatically when ready. + - if: '$CI_MERGE_REQUEST_ID' + when: on_success + .run_manually: rules: - - if: '($CMAKE_CI_JOB_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' - when: never - - if: '$CI_MERGE_REQUEST_ID' - when: manual - if: '$CI_PIPELINE_SOURCE == "schedule"' when: on_success - when: manual .run_automatically: rules: - - if: '($CMAKE_CI_JOB_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' - when: never - - if: '$CI_MERGE_REQUEST_ID' - when: on_success - if: '$CI_PIPELINE_SOURCE == "schedule"' when: on_success - when: delayed @@ -187,8 +194,4 @@ workflow: .run_dependent: rules: - - if: '($CMAKE_CI_JOB_NO_MR == "true" && $CI_MERGE_REQUEST_ID)' - when: never - - if: '$CI_MERGE_REQUEST_ID' - when: on_success - when: on_success From 2b944b7b267fff64eec866dc552608aac28be3f7 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 15 Jan 2026 21:56:22 -0500 Subject: [PATCH 11/16] gitlab-ci: port scheduled pipeline logic to the single rules block Co-authored-by: Brad King --- .gitlab/rules.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index ed990922ef..1758edf467 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -179,16 +179,17 @@ workflow: - if: '$CI_MERGE_REQUEST_ID' when: on_success -.run_manually: - rules: + ### Scheduled pipelines. + # Scheduled pipelines run all jobs automatically when ready. - if: '$CI_PIPELINE_SOURCE == "schedule"' when: on_success + +.run_manually: + rules: - when: manual .run_automatically: rules: - - if: '$CI_PIPELINE_SOURCE == "schedule"' - when: on_success - when: delayed start_in: 5 minutes From 51fc225941bc5ef0450033510f5e4227c9834907 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 15 Jan 2026 22:01:03 -0500 Subject: [PATCH 12/16] gitlab-ci: use a single rules block for "manual" jobs Co-authored-by: Brad King --- .gitlab-ci.yml | 58 +++++++++++++++++++++++++++++--------------- .gitlab/os-linux.yml | 6 +++-- .gitlab/rules.yml | 7 +++--- 3 files changed, 47 insertions(+), 24 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index cb05bc5dd6..134bcd251e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -180,9 +180,10 @@ b:fedora43-gcc-gcov: - .cmake_build_linux - .cmake_build_artifacts - .linux_x86_64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" t:fedora43-gcc-gcov: extends: @@ -216,9 +217,10 @@ b:fedora43-bullseye-coverage: - .cmake_build_linux - .cmake_build_artifacts - .linux_x86_64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" t:fedora43-bullseye-coverage: extends: @@ -254,9 +256,10 @@ b:centos7-x86_64: - .cmake_build_linux_release - .cmake_release_artifacts - .linux_x86_64_tags - - .run_manually + - .rules variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-centos7-x86_64" + CMAKE_CI_JOB_RUN_MANUALLY: "true" b:centos8-aarch64: extends: @@ -264,10 +267,11 @@ b:centos8-aarch64: - .cmake_build_linux_release - .cmake_release_artifacts - .linux_aarch64_tags - - .run_manually + - .rules variables: CMAKE_CI_ARTIFACTS_NAME: "artifacts-centos8-aarch64" CMAKE_CI_JOB_NO_MR: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" t:debian13-ninja: extends: @@ -676,9 +680,10 @@ b:fedora43-ninja: - .cmake_build_linux - .cmake_build_artifacts - .linux_x86_64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_CONTINUOUS: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" b:fedora43-makefiles-symlinked: extends: @@ -686,45 +691,50 @@ b:fedora43-makefiles-symlinked: - .cmake_build_linux - .cmake_build_artifacts - .linux_x86_64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" b:debian13-makefiles-inplace: extends: - .debian13_makefiles_inplace - .cmake_build_linux_standalone - .linux_x86_64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" b:debian13-extdeps: extends: - .debian13_extdeps - .cmake_build_linux_standalone - .linux_x86_64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" b:debian13-aarch64-extdeps: extends: - .debian13_aarch64_extdeps - .cmake_build_linux_standalone - .linux_aarch64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" b:fedora43-extdeps: extends: - .fedora43_extdeps - .cmake_build_linux_standalone - .linux_x86_64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" t:fedora43-ninja: extends: @@ -1085,9 +1095,10 @@ b:fedora43-asan: - .cmake_build_linux - .cmake_build_artifacts - .linux_x86_64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" t:fedora43-asan: extends: @@ -1122,9 +1133,10 @@ b:macos-x86_64-ninja: - .cmake_build_macos - .cmake_build_artifacts - .macos_x86_64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_NO_MR: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" b:macos-arm64-ninja: extends: @@ -1132,9 +1144,10 @@ b:macos-arm64-ninja: - .cmake_build_macos - .cmake_build_artifacts - .macos_arm64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_CONTINUOUS: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" b:macos-arm64-ninja-symlinked: extends: @@ -1142,18 +1155,20 @@ b:macos-arm64-ninja-symlinked: - .cmake_build_macos - .cmake_build_artifacts - .macos_arm64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" b:macos-arm64-pch: extends: - .macos_arm64_pch - .cmake_build_macos - .macos_arm64_tags - - .run_manually + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" t:macos-x86_64-ninja: extends: @@ -1199,7 +1214,9 @@ b:macos-x86_64-makefiles: - .cmake_build_macos - .cmake_build_artifacts - .macos_x86_64_tags - - .run_manually + - .rules + variables: + CMAKE_CI_JOB_RUN_MANUALLY: "true" t:macos-x86_64-makefiles: extends: @@ -1370,18 +1387,20 @@ b:windows-vs2026-x64-ninja: - .cmake_build_windows - .cmake_build_artifacts - .windows_x86_64_tags_nonconcurrent_vs2026 - - .run_manually + - .rules variables: CMAKE_CI_JOB_CONTINUOUS: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" b:windows-vs2026-x64-pch: extends: - .windows_vs2026_x64_pch - .cmake_build_windows - .windows_x86_64_tags_nonconcurrent_vs2026 - - .run_manually + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" t:windows-vs2026-x64-ninja: extends: @@ -1670,9 +1689,10 @@ b:windows-arm64-vs2026-ninja: - .cmake_build_windows - .cmake_build_artifacts - .windows_arm64_tags_nonconcurrent_vs2026 - - .run_manually + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" t:windows-arm64-vs2026-ninja: extends: diff --git a/.gitlab/os-linux.yml b/.gitlab/os-linux.yml index 803b105fee..b8744327ff 100644 --- a/.gitlab/os-linux.yml +++ b/.gitlab/os-linux.yml @@ -903,21 +903,23 @@ - .intelclassic_makefiles - .cmake_test_linux_release - .linux_x86_64_tags - - .run_manually + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" CMAKE_CI_JOB_NO_MR: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" .cmake_test_linux_inteloneapi_makefiles: extends: - .inteloneapi_makefiles - .cmake_test_linux_release - .linux_x86_64_tags - - .run_manually + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" + CMAKE_CI_JOB_RUN_MANUALLY: "true" .cmake_build_sunos_release: stage: build diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index 1758edf467..b71a2ea05e 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -184,9 +184,10 @@ workflow: - if: '$CI_PIPELINE_SOURCE == "schedule"' when: on_success -.run_manually: - rules: - - when: manual + ### Other pipelines. + # Other pipelines run manual jobs upon request. + - if: '$CMAKE_CI_JOB_RUN_MANUALLY == "true"' + when: manual .run_automatically: rules: From b1ec96bfa754a59d70ef40681d4af61bc83e8ec0 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 15 Jan 2026 21:58:46 -0500 Subject: [PATCH 13/16] gitlab-ci: use a single rules block for "automatic" jobs Co-authored-by: Brad King --- .gitlab-ci.yml | 14 +++++++------- .gitlab/rules.yml | 7 +++---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 134bcd251e..f8bf08ea09 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -119,7 +119,7 @@ l:spellcheck: extends: - .cmake_spellcheck_linux - .linux_x86_64_tags - - .run_automatically + - .rules l:iwyu-debian13: extends: @@ -127,7 +127,7 @@ l:iwyu-debian13: - .cmake_build_linux - .linux_x86_64_tags - .cmake_cdash_artifacts - - .run_automatically + - .rules l:tidy-fedora43: extends: @@ -136,7 +136,7 @@ l:tidy-fedora43: - .cmake_tidy_artifacts - .linux_x86_64_tags - .cmake_cdash_artifacts - - .run_automatically + - .rules l:sphinx-fedora43: extends: @@ -144,7 +144,7 @@ l:sphinx-fedora43: - .cmake_build_linux - .cmake_sphinx_artifacts - .linux_x86_64_tags - - .run_automatically + - .rules variables: CMAKE_CI_JOB_CONTINUOUS: "true" CMAKE_CI_JOB_HELP: "true" @@ -154,7 +154,7 @@ l:clang-analyzer-fedora43: - .fedora43_clang_analyzer - .cmake_build_linux - .linux_x86_64_tags - - .run_automatically + - .rules variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -163,14 +163,14 @@ l:clang-fuzzing-fedora43: - .fedora43_clang_fuzzing - .cmake_build_linux - .linux_x86_64_tags - - .run_automatically + - .rules l:clazy-fedora43: extends: - .fedora43_clazy - .cmake_build_linux - .linux_x86_64_tags - - .run_automatically + - .rules # Coverage builds diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index b71a2ea05e..a27f62cbc7 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -188,10 +188,9 @@ workflow: # Other pipelines run manual jobs upon request. - if: '$CMAKE_CI_JOB_RUN_MANUALLY == "true"' when: manual - -.run_automatically: - rules: - - when: delayed + # Other pipelines run jobs in the `build` stage automatically after 5 minutes. + - if: '$CI_JOB_STAGE == "build"' + when: delayed start_in: 5 minutes .run_dependent: From d505cf03d9e9ce5aa1c9e58dfd90dd1c83370e4a Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 15 Jan 2026 21:57:32 -0500 Subject: [PATCH 14/16] gitlab-ci: use a single rules block for "dependent" jobs Co-authored-by: Brad King --- .gitlab-ci.yml | 164 +++++++++++++++++++++++----------------------- .gitlab/rules.yml | 4 +- 2 files changed, 83 insertions(+), 85 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f8bf08ea09..72860a8e38 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -191,7 +191,7 @@ t:fedora43-gcc-gcov: - .cmake_test_linux - .cmake_coverage_artifacts - .linux_x86_64_tags_x11 - - .run_dependent + - .rules # Run coverage analysis even if the tests fail. allow_failure: true needs: @@ -205,7 +205,7 @@ a:fedora43-gcc-gcov: - .cmake_coverage_linux - .cmake_cdash_artifacts - .linux_x86_64_tags - - .run_dependent + - .rules needs: - t:fedora43-gcc-gcov variables: @@ -228,7 +228,7 @@ t:fedora43-bullseye-coverage: - .cmake_test_linux - .cmake_coverage_artifacts - .linux_x86_64_tags_x11 - - .run_dependent + - .rules # Run coverage analysis even if the tests fail. allow_failure: true needs: @@ -242,7 +242,7 @@ a:fedora43-bullseye-coverage: - .cmake_coverage_linux - .cmake_cdash_artifacts - .linux_x86_64_tags - - .run_dependent + - .rules needs: - t:fedora43-bullseye-coverage variables: @@ -279,7 +279,7 @@ t:debian13-ninja: - .cmake_test_linux_release - .linux_x86_64_tags - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY_NINJA: "true" @@ -290,7 +290,7 @@ t:debian13-aarch64-ninja: - .cmake_test_linux_release - .linux_aarch64_tags - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos8_aarch64 variables: CMAKE_CI_JOB_NO_MR: "true" @@ -300,7 +300,7 @@ t:debian13-ninja-clang: - .debian13_ninja_clang - .cmake_test_linux_release - .linux_x86_64_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -310,7 +310,7 @@ t:debian13-makefiles-clang: - .debian13_makefiles_clang - .cmake_test_linux_release - .linux_x86_64_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -321,7 +321,7 @@ t:debian13-ninja-multi-symlinked: - .cmake_test_linux_release - .linux_x86_64_tags - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -332,7 +332,7 @@ t:debian13-hip-radeon: - .debian13_hip_radeon - .cmake_test_linux_release - .linux_x86_64_tags_rocm5.7 - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -342,7 +342,7 @@ t:fedora43-hip-radeon: - .fedora43_hip_radeon - .cmake_test_linux_release - .linux_x86_64_tags_rocm6.2 - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -352,7 +352,7 @@ t:fedora43-makefiles-lfortran: - .fedora43_makefiles_lfortran - .cmake_test_linux_release - .linux_x86_64_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -362,7 +362,7 @@ t:fedora43-ninja-lfortran: - .fedora43_ninja_lfortran - .cmake_test_linux_release - .linux_x86_64_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -372,7 +372,7 @@ t:fedora43-ninja-multi: - .fedora43_ninja_multi - .cmake_test_linux_release - .linux_x86_64_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 t:fedora43-ninja-clang: @@ -380,7 +380,7 @@ t:fedora43-ninja-clang: - .fedora43_ninja_clang - .cmake_test_linux_release - .linux_x86_64_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -390,7 +390,7 @@ t:fedora43-ninja-multi-clang: - .fedora43_ninja_multi_clang - .cmake_test_linux_release - .linux_x86_64_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -400,7 +400,7 @@ t:fedora43-makefiles-clang: - .fedora43_makefiles_clang - .cmake_test_linux_release - .linux_x86_64_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -410,7 +410,7 @@ t:fedora43-makefiles: - .fedora43_makefiles - .cmake_test_linux_release - .linux_x86_64_v3_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 t:fedora43-makefiles-nospace: @@ -419,7 +419,7 @@ t:fedora43-makefiles-nospace: - .cmake_test_linux_release - .linux_x86_64_v3_tags - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: GIT_CLONE_PATH: "$CI_BUILDS_DIR/cmake-ci" @@ -431,7 +431,7 @@ t:fedora43-fastbuild: - .fedora43_fastbuild - .cmake_test_linux_release - .linux_x86_64_v3_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -441,7 +441,7 @@ t:fedora43-instrumentation: - .fedora43_ninja_instrumentation - .cmake_test_linux_release - .linux_x86_64_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 - .cmake_junit_artifacts variables: @@ -452,7 +452,7 @@ t:nvhpc24.9-ninja: - .nvhpc_ninja - .cmake_test_linux_release - .linux_x86_64_v3_tags_cuda_arch_52 - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -462,7 +462,7 @@ t:cuda9.2-nvidia: - .cuda9.2_nvidia - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_30 - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -473,7 +473,7 @@ t:cuda10.2-nvidia: - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_52 - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -483,7 +483,7 @@ t:cuda10.2-clang: - .cuda10.2_clang - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_52 - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -494,7 +494,7 @@ t:cuda11.6-nvidia: - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_52 - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -504,7 +504,7 @@ t:cuda11.6-clang: - .cuda11.6_clang - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_52 - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -514,7 +514,7 @@ t:cuda11.8-minimal-ninja: - .cuda11.8_minimal_nvidia - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_52 - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -524,7 +524,7 @@ t:cuda11.8-minimal-splayed-ninja: - .cuda11.8_splayed_nvidia - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_52 - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -535,7 +535,7 @@ t:cuda12.2-nvidia: - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_52 - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -545,7 +545,7 @@ t:cuda12.2-clang: - .cuda12.2_clang - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_52 - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -556,7 +556,7 @@ t:cuda12.6-nvidia: - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_52 - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -567,7 +567,7 @@ t:cuda12.6-nvidia-clang: - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_52 - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -577,7 +577,7 @@ t:cuda12.6-clang: - .cuda12.6_clang - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_52 - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -588,7 +588,7 @@ t:cuda13.0-nvidia: - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_75 - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos7_x86_64 t:cuda13.0-aarch64-nvidia: @@ -597,7 +597,7 @@ t:cuda13.0-aarch64-nvidia: - .cmake_test_linux_release - .linux_aarch64_tags_cuda_arch_75 - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos8_aarch64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -608,7 +608,7 @@ t:cuda13.0-nvidia-fastbuild: - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_75 - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -618,7 +618,7 @@ t:hip6.3-nvidia: - .hip6.3_nvidia - .cmake_test_linux_release - .linux_x86_64_tags_cuda_arch_52 - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -628,7 +628,7 @@ t:hip6.3-radeon: - .hip6.3_radeon - .cmake_test_linux_release - .linux_x86_64_tags_rocm6.3 - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -638,7 +638,7 @@ t:linux-gcc-cxx-modules-reloc-ninja: - .gcc_cxx_modules_reloc_ninja - .cmake_test_linux_release - .linux_x86_64_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -648,7 +648,7 @@ t:linux-gcc-cxx-modules-ninja: - .gcc_cxx_modules_ninja - .cmake_test_linux_release - .linux_x86_64_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -658,7 +658,7 @@ t:linux-gcc-cxx-modules-ninja-multi: - .gcc_cxx_modules_ninja_multi - .cmake_test_linux_release - .linux_x86_64_tags - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -669,7 +669,7 @@ t:debian10-legacy: - .cmake_test_linux_release - .linux_x86_64_tags - .cmake_junit_artifacts - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -742,7 +742,7 @@ t:fedora43-ninja: - .cmake_test_linux - .linux_x86_64_tags_x11 - .cmake_test_artifacts - - .run_dependent + - .rules needs: - b:fedora43-ninja variables: @@ -754,7 +754,7 @@ t:fedora43-makefiles-symlinked: - .cmake_test_linux - .linux_x86_64_tags_x11 - .cmake_test_artifacts - - .run_dependent + - .rules needs: - b:fedora43-makefiles-symlinked variables: @@ -1106,7 +1106,7 @@ t:fedora43-asan: - .cmake_memcheck_linux - .linux_x86_64_tags - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - b:fedora43-asan variables: @@ -1119,7 +1119,7 @@ t:fedora43-ninja-valgrind: # Use a fast CPU so that timeouts are less of a concern. - .linux_x86_64_tags_fast_x11 - .cmake_valgrind_artifacts - - .run_dependent + - .rules - .needs_centos7_x86_64 variables: CMAKE_CI_JOB_NIGHTLY: "true" @@ -1176,7 +1176,7 @@ t:macos-x86_64-ninja: - .cmake_test_macos - .cmake_test_artifacts - .macos_x86_64_tags - - .run_dependent + - .rules needs: - b:macos-x86_64-ninja variables: @@ -1188,7 +1188,7 @@ t:macos-arm64-ninja: - .cmake_test_macos - .cmake_test_artifacts - .macos_arm64_tags - - .run_dependent + - .rules needs: - b:macos-arm64-ninja variables: @@ -1201,7 +1201,7 @@ t:macos-arm64-ninja-symlinked: - .cmake_test_macos - .cmake_test_artifacts - .macos_arm64_tags - - .run_dependent + - .rules needs: - b:macos-arm64-ninja-symlinked variables: @@ -1223,7 +1223,7 @@ t:macos-x86_64-makefiles: - .macos_x86_64_makefiles - .cmake_test_macos - .macos_x86_64_tags - - .run_dependent + - .rules needs: - b:macos-x86_64-makefiles @@ -1233,7 +1233,7 @@ t:macos-arm64-ninja-multi: - .cmake_test_macos_external - .macos_arm64_tags_ext - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:macos-arm64-ninja variables: @@ -1245,7 +1245,7 @@ t:macos-x86_64-xcode: - .cmake_test_macos_external - .macos_x86_64_tags_ext - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:macos-x86_64-ninja variables: @@ -1257,7 +1257,7 @@ t:macos-arm64-xcode: - .cmake_test_macos_external - .macos_arm64_tags_ext - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:macos-arm64-ninja @@ -1267,7 +1267,7 @@ t:macos-arm64-fastbuild: - .cmake_test_macos_external - .macos_arm64_tags_ext - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:macos-arm64-ninja variables: @@ -1279,7 +1279,7 @@ t:macos-arm64-xcode-symlinked: - .cmake_test_macos_external - .macos_arm64_tags_ext - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:macos-arm64-ninja variables: @@ -1291,7 +1291,7 @@ t:macos-x86_64-ninja-ub: - .cmake_test_macos_external - .macos_x86_64_tags_ext - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:macos-x86_64-ninja variables: @@ -1303,7 +1303,7 @@ t:macos-arm64-xcode-ub: - .cmake_test_macos_external - .macos_arm64_tags_ext - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:macos-arm64-ninja variables: @@ -1408,7 +1408,7 @@ t:windows-vs2026-x64-ninja: - .cmake_test_windows - .windows_x86_64_tags_nonconcurrent_vs2026 - .cmake_test_artifacts - - .run_dependent + - .rules needs: - b:windows-vs2026-x64-ninja variables: @@ -1421,7 +1421,7 @@ t:windows-vs2026-x64-ninja-multi: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2026 - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1432,7 +1432,7 @@ t:windows-vs2026-x64-ninja-multi: - .windows_vs2026_x64 - .cmake_test_windows_external - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja @@ -1465,7 +1465,7 @@ t:windows-vs2022-x64: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2022_android - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1477,7 +1477,7 @@ t:windows-vs2019-x64: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2019_android - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1489,7 +1489,7 @@ t:windows-vs2026-x64-nmake: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2026 - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1501,7 +1501,7 @@ t:windows-vs2026-x64-jom: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2026 - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1513,7 +1513,7 @@ t:windows-vs2026-x64-fastbuild: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2026 - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1525,7 +1525,7 @@ t:windows-borland5.5: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1537,7 +1537,7 @@ t:windows-borland5.8: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1549,7 +1549,7 @@ t:windows-clang19.1-cl-ninja: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2022_msvc14.44 - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1562,7 +1562,7 @@ t:windows-clang19.1-cl-nmake: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2022_msvc14.44 - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1575,7 +1575,7 @@ t:windows-clang19.1-gnu-ninja: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2022_msvc14.44 - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1588,7 +1588,7 @@ t:windows-clang19.1-gnu-nmake: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2022_msvc14.44 - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1601,7 +1601,7 @@ t:windows-intel2021.9-ninja: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2022_msvc14.43 - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1614,7 +1614,7 @@ t:windows-oneapi2025.1-ninja: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent_vs2022_msvc14.44 - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1627,7 +1627,7 @@ t:mingw_osdn_io-mingw_makefiles: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1639,7 +1639,7 @@ t:mingw_osdn_io-msys_makefiles: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1651,7 +1651,7 @@ t:windows-msvc-v71-nmake: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1663,7 +1663,7 @@ t:windows-openwatcom1.9: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1675,7 +1675,7 @@ t:windows-orangec6.73.1: - .cmake_test_windows_external - .windows_x86_64_tags_concurrent - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-vs2026-x64-ninja variables: @@ -1700,7 +1700,7 @@ t:windows-arm64-vs2026-ninja: - .cmake_test_windows - .windows_arm64_tags_nonconcurrent_vs2026 - .cmake_test_artifacts - - .run_dependent + - .rules needs: - b:windows-arm64-vs2026-ninja variables: @@ -1712,7 +1712,7 @@ t:windows-arm64-vs2026: - .cmake_test_windows_external - .windows_arm64_tags_concurrent_vs2026 - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-arm64-vs2026-ninja variables: @@ -1724,7 +1724,7 @@ t:windows-arm64-vs2022: - .cmake_test_windows_external - .windows_arm64_tags_concurrent_vs2022 - .cmake_junit_artifacts - - .run_dependent + - .rules needs: - t:windows-arm64-vs2026-ninja variables: diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index a27f62cbc7..b224cc0bfb 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -192,7 +192,5 @@ workflow: - if: '$CI_JOB_STAGE == "build"' when: delayed start_in: 5 minutes - -.run_dependent: - rules: + # Other pipelines run other jobs automatically when ready. - when: on_success From fff061d1e70f683ec2ec71bbbce9e8da2df3f0f9 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 15 Jan 2026 22:18:48 -0500 Subject: [PATCH 15/16] gitlab-ci: name pipelines This makes it easier to see pipeline reasons in the web UI. Co-authored-by: Brad King --- .gitlab/rules.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index b224cc0bfb..8fbf96c998 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -42,8 +42,12 @@ ## Set to the name of the staging branch where continuous pipelines run. #### +variables: + CMAKE_CI_PIPELINE_NAME: 'Branch "$CI_COMMIT_REF_NAME"' + # When to even consider running a pipeline. workflow: + name: "$CMAKE_CI_PIPELINE_NAME" rules: # Run for merge requests. - if: '$CI_MERGE_REQUEST_ID' @@ -51,6 +55,8 @@ workflow: auto_cancel: # Cancel all pipeline jobs if a new commit comes in on the branch/tag. on_new_commit: interruptible + variables: + CMAKE_CI_PIPELINE_NAME: 'Merge request !$CI_MERGE_REQUEST_IID' # If this is not a MR, do not run for other projects. - if: '$CI_PROJECT_PATH != "cmake/cmake" && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == null && $CMAKE_CI_PROJECT_MAIN_BRANCH == null' when: never @@ -60,15 +66,21 @@ workflow: auto_cancel: # Never cancel scheduled pipelines because of new commits. on_new_commit: none + variables: + CMAKE_CI_PIPELINE_NAME: 'Schedule "$CI_PIPELINE_SCHEDULE_DESCRIPTION"' # Run for protected branches. - if: '$CI_COMMIT_REF_PROTECTED == "true"' when: always auto_cancel: # Cancel all pipeline jobs if a new commit comes in on the branch. on_new_commit: interruptible + variables: + CMAKE_CI_PIPELINE_NAME: 'Protected branch "$CI_COMMIT_REF_NAME"' # Run for tags. - if: '$CI_COMMIT_TAG' when: always + variables: + CMAKE_CI_PIPELINE_NAME: 'Tag "$CI_COMMIT_TAG"' # Skip pipelines in all other cases. - when: never From 537828483de7daa578db575a94346cfbd3b0ae08 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 23 Jan 2026 20:36:39 -0500 Subject: [PATCH 16/16] gitlab-ci: configure development documentation and continuous pipelines Use the default cancellation policy so that continuous pipelines that have started can finish. --- .gitlab/rules.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.gitlab/rules.yml b/.gitlab/rules.yml index 8fbf96c998..b0ac9a65e1 100644 --- a/.gitlab/rules.yml +++ b/.gitlab/rules.yml @@ -68,6 +68,16 @@ workflow: on_new_commit: none variables: CMAKE_CI_PIPELINE_NAME: 'Schedule "$CI_PIPELINE_SCHEDULE_DESCRIPTION"' + # Run for development documentation. + - if: '$CMAKE_CI_PROJECT_MAIN_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_MAIN_BRANCH == $CI_COMMIT_BRANCH' + when: always + variables: + CMAKE_CI_PIPELINE_NAME: 'Development documentation on branch "$CI_COMMIT_REF_NAME"' + # Run for continuous testing of staging branch. + - if: '$CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != null && $CI_COMMIT_BRANCH != null && $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH == $CI_COMMIT_BRANCH' + when: always + variables: + CMAKE_CI_PIPELINE_NAME: 'Continuous branch "$CI_COMMIT_REF_NAME"' # Run for protected branches. - if: '$CI_COMMIT_REF_PROTECTED == "true"' when: always