Bladeren bron

ENH: Add Site and Build Name for CDash

Show names linked with github in CDash (the number of the commit and the branch are shown in the Build Name on CDash)
Redundant variable are deleted
Better condition testing for SITE_BUILD_TYPE
mayeul 8 jaren geleden
bovenliggende
commit
5397ddaea1
5 gewijzigde bestanden met toevoegingen van 90 en 14 verwijderingen
  1. 80 0
      CMake/CircleCI/CircleCI_CTK_Docker.cmake
  2. 1 1
      CMake/CircleCI/run.sh
  3. 3 3
      CMake/CircleCI/run_opengl.sh
  4. 5 9
      CMake/CircleCI/test.sh
  5. 1 1
      circle.yml

+ 80 - 0
CMake/CircleCI/CircleCI_CTK_Docker.cmake

@@ -0,0 +1,80 @@
+##############################################################################
+#
+# Library:   CTK
+#
+# Copyright 2010 Kitware Inc. 28 Corporate Drive,
+# Clifton Park, NY, 12065, USA.
+#
+# All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+##############################################################################
+
+
+set( CTK_SOURCE_DIR "/usr/src/CTK" )
+set( CTK_BINARY_DIR "/usr/src/CTK-build" )
+
+set( CTEST_SOURCE_DIRECTORY "${CTK_SOURCE_DIR}" )
+set( CTEST_BINARY_DIRECTORY "${CTK_BINARY_DIR}/CTK-build" )
+
+#############
+
+set( SITE_CTEST_MODE "Experimental" ) # Experimental, Continuous, or Nightly
+
+set( CTEST_CMAKE_GENERATOR "Unix Makefiles" ) # Ninja or Unix Makefiles
+
+set( CTK_GIT_REPOSITORY "https://github.com/commontk/CTK.git" )
+
+# Follow format for caps and components as given on CTK dashboard
+set( CTEST_SITE "CircleCI_CTK" )
+
+# Follow format for caps and components as given on CTK dashboard
+set( SITE_PLATFORM "Ubuntu-64" )
+
+# Use SITE_BUILD_TYPE specified by circle.yml
+set( SITE_BUILD_TYPE "$ENV{SITE_BUILD_TYPE}" )
+if( NOT( (SITE_BUILD_TYPE MATCHES "Debug") OR (SITE_BUILD_TYPE MATCHES "Release") ) )
+  set( SITE_BUILD_TYPE "Debug" ) # Release, Debug
+endif( NOT( (SITE_BUILD_TYPE MATCHES "Debug") OR (SITE_BUILD_TYPE MATCHES "Release") ) )
+
+# Named SITE_BUILD_NAME
+string( SUBSTRING $ENV{CIRCLE_SHA1} 0 7 commit )
+set( what $ENV{CIRCLE_BRANCH} )
+set( SITE_BUILD_NAME_SUFFIX _${commit}_${what} )
+
+set( SITE_BUILD_NAME "CircleCI-${SITE_PLATFORM}-${SITE_BUILD_TYPE}${SITE_BUILD_NAME_SUFFIX}" )
+
+set( CTEST_BUILD_NAME "${SITE_BUILD_NAME}-BuildTest-${SITE_CTEST_MODE}" )
+
+###################
+
+set( CTEST_CONFIGURATION_TYPE "${SITE_BUILD_TYPE}")
+set( CMAKE_BUILD_TYPE "${SITE_BUILD_TYPE}")
+set( BUILD_TESTING ON )
+set( CTK_BUILD_EXAMPLES OFF )
+
+
+###################
+
+
+ctest_start( "${SITE_CTEST_MODE}" )
+
+ctest_configure( BUILD "${CTK_BINARY_DIR}"
+    SOURCE "${CTK_SOURCE_DIR}" )
+
+ctest_build( BUILD ${CTK_BINARY_DIR} )
+
+ctest_test( BUILD ${CTEST_BINARY_DIRECTORY} )
+
+ctest_submit()

+ 1 - 1
CMake/CircleCI/run.sh

@@ -2,4 +2,4 @@
 
 
 script_dir="`cd $(dirname $0); pwd`"
 script_dir="`cd $(dirname $0); pwd`"
 
 
-$script_dir/run_opengl.sh -i commontk/ctk-test:opengl -p 6081 "$@"
+$script_dir/run_opengl.sh -i commontk/ctk-test:opengl -p 6081 -r --env="CIRCLE_SHA1=$1" -r --env="CIRCLE_BRANCH=$2" -r --env="SITE_BUILD_TYPE=$3"

+ 3 - 3
CMake/CircleCI/run_opengl.sh

@@ -114,7 +114,7 @@ if [ -z "$quiet" ]; then
 	fi
 	fi
 fi
 fi
 
 
-pwd_dir="$(pwd)"
+pwd_dir="`cd $(dirname $0)/../..; pwd`"
 mount_local=""
 mount_local=""
 if [ "${os}" = "Linux" ] || [ "${os}" = "Darwin" ]; then
 if [ "${os}" = "Linux" ] || [ "${os}" = "Darwin" ]; then
 	mount_local=" -v ${pwd_dir}:/usr/src/CTK "
 	mount_local=" -v ${pwd_dir}:/usr/src/CTK "
@@ -144,7 +144,7 @@ print_app_output() {
 trap "docker stop $container >/dev/null && print_app_output" SIGINT SIGTERM
 trap "docker stop $container >/dev/null && print_app_output" SIGINT SIGTERM
 
 
 docker wait $container >/dev/null
 docker wait $container >/dev/null
-echo "avant"
+
 print_app_output
 print_app_output
-echo "apres"
+
 # vim: noexpandtab shiftwidth=4 tabstop=4 softtabstop=0
 # vim: noexpandtab shiftwidth=4 tabstop=4 softtabstop=0

+ 5 - 9
CMake/CircleCI/test.sh

@@ -11,13 +11,9 @@ die() {
 mkdir /usr/src/CTK-build
 mkdir /usr/src/CTK-build
 cd /usr/src/CTK-build || die "Could not cd into the build directory"
 cd /usr/src/CTK-build || die "Could not cd into the build directory"
 
 
-cmake \
-  -DCMAKE_BUILD_TYPE:STRING=Debug \
-  -DBUILD_TESTING:BOOL=ON \
-  -DCTK_BUILD_EXAMPLES:BOOL=ON \
-    /usr/src/CTK || die "CMake configuration failed"
-
-make -j3 || die "examples build failed"
-
+mkdir /usr/src/CTK-build/CTK-build
 cd /usr/src/CTK-build/CTK-build || die "Could not cd into the build directory"
 cd /usr/src/CTK-build/CTK-build || die "Could not cd into the build directory"
-ctest -VV -D Experimental || die "ctest failed"
+
+ctest \
+  -S /usr/src/CTK/CMake/CircleCI/CircleCI_CTK_Docker.cmake \
+  -VV || die "ctest failed"

+ 1 - 1
circle.yml

@@ -9,4 +9,4 @@ dependencies:
 
 
 test:
 test:
   override:
   override:
-    - ~/CTK/CMake/CircleCI/run.sh
+    - ~/CTK/CMake/CircleCI/run.sh $CIRCLE_SHA1 $CIRCLE_BRANCH $SITE_BUILD_TYPE