Browse Source

Merge topic 'ci-nightly'

dd47d0d7f4 gitlab-ci: add rules to enable jobs in a nightly pipeline schedule
3f494b12ea gitlab-ci: configure continuous job ctest build name and model accordingly
63c7e7ca04 gitlab-ci: factor out ctest_start() model into a variable
0556bd2f8a gitlab-ci: use ctest_start GROUP option instead of deprecated TRACK

Acked-by: Kitware Robot <[email protected]>
Merge-request: !5334
Brad King 5 years ago
parent
commit
7f1a36deea

+ 1 - 1
.gitlab/ci/ctest_configure.cmake

@@ -6,7 +6,7 @@ set(cmake_args
   -C "${CMAKE_CURRENT_LIST_DIR}/configure_$ENV{CMAKE_CONFIGURATION}.cmake")
 
 # Create an entry in CDash.
-ctest_start(Experimental TRACK "${ctest_track}")
+ctest_start("${ctest_model}" GROUP "${ctest_group}")
 
 # Gather update information.
 find_package(Git)

+ 1 - 1
.gitlab/ci/ctest_test_external.cmake

@@ -7,7 +7,7 @@ set(cmake_args
   -C "${CMAKE_CURRENT_LIST_DIR}/configure_$ENV{CMAKE_CONFIGURATION}.cmake")
 
 # Create an entry in CDash.
-ctest_start(Experimental TRACK "${ctest_track}")
+ctest_start("${ctest_model}" GROUP "${ctest_group}")
 
 # Gather update information.
 find_package(Git)

+ 14 - 7
.gitlab/ci/gitlab_ci.cmake

@@ -19,6 +19,7 @@ endif ()
 # Set the build metadata.
 set(CTEST_BUILD_NAME "$ENV{CI_PROJECT_NAME}-$ENV{CMAKE_CONFIGURATION}")
 set(CTEST_SITE "gitlab-ci")
+set(ctest_model "Experimental")
 
 # Default to Release builds.
 if (NOT "$ENV{CMAKE_BUILD_TYPE}" STREQUAL "")
@@ -45,20 +46,26 @@ if (NOT "$ENV{CMAKE_GENERATOR_TOOLSET}" STREQUAL "")
   set(CTEST_CMAKE_GENERATOR_TOOLSET "$ENV{CMAKE_GENERATOR_TOOLSET}")
 endif ()
 
-# Determine the track to submit to.
-set(ctest_track "Experimental")
+# Determine the group to submit to.
+set(ctest_group "Experimental")
 if (NOT "$ENV{CI_MERGE_REQUEST_ID}" STREQUAL "")
-  set(ctest_track "merge-requests")
+  set(ctest_group "merge-requests")
 elseif (NOT "$ENV{CMAKE_CI_PROJECT_CONTINUOUS_BRANCH}" STREQUAL "" AND "$ENV{CMAKE_CI_PROJECT_CONTINUOUS_BRANCH}" STREQUAL "$ENV{CI_COMMIT_BRANCH}" AND NOT "$ENV{CMAKE_CI_JOB_CONTINUOUS}" STREQUAL "")
+  set(ctest_model "Continuous")
   if (NOT "$ENV{CMAKE_CI_JOB_HELP}" STREQUAL "")
-    set(ctest_track "Continuous Help")
+    set(ctest_group "Continuous Help")
   else()
-    set(ctest_track "Continuous")
+    set(ctest_group "Continuous")
   endif()
+  string(PREPEND CTEST_BUILD_NAME "continuous-")
+elseif (NOT "$ENV{CMAKE_CI_NIGHTLY}" STREQUAL "")
+  set(ctest_model "Nightly")
+  set(ctest_group "Nightly Expected")
+  string(PREPEND CTEST_BUILD_NAME "nightly-")
 elseif ("$ENV{CI_PROJECT_PATH}" STREQUAL "cmake/cmake")
   if ("$ENV{CI_COMMIT_REF_NAME}" STREQUAL "master")
-    set(ctest_track "master")
+    set(ctest_group "master")
   elseif ("$ENV{CI_COMMIT_REF_NAME}" STREQUAL "release")
-    set(ctest_track "release")
+    set(ctest_group "release")
   endif ()
 endif ()

+ 6 - 0
.gitlab/rules.yml

@@ -4,6 +4,8 @@
     rules:
         - if: '$CMAKE_CI_PACKAGE == "true"'
           when: never
+        - if: '$CMAKE_CI_NIGHTLY == "true"'
+          when: on_success
         - if: '($CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != "" && $CI_COMMIT_BRANCH == $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true")'
           when: delayed
           start_in: 5 minutes
@@ -18,6 +20,8 @@
     rules:
         - if: '$CMAKE_CI_PACKAGE == "true"'
           when: never
+        - if: '$CMAKE_CI_NIGHTLY == "true"'
+          when: on_success
         - if: '($CMAKE_CI_PROJECT_CONTINUOUS_BRANCH != "" && $CI_COMMIT_BRANCH == $CMAKE_CI_PROJECT_CONTINUOUS_BRANCH && $CMAKE_CI_JOB_CONTINUOUS == "true")'
           when: on_success
         - if: '$CI_MERGE_REQUEST_ID'
@@ -30,6 +34,8 @@
     rules:
         - if: '$CMAKE_CI_PACKAGE == "true"'
           when: never
+        - if: '$CMAKE_CI_NIGHTLY == "true"'
+          when: on_success
         - if: '$CI_MERGE_REQUEST_ID'
           when: on_success
         - if: '$CI_PROJECT_PATH == "cmake/cmake"'