[geos-commits] r3914 - in trunk: . tools tools/ci

svn_geos at osgeo.org svn_geos at osgeo.org
Thu Aug 22 00:12:50 PDT 2013


Author: strk
Date: 2013-08-22 00:12:50 -0700 (Thu, 22 Aug 2013)
New Revision: 3914

Added:
   trunk/.travis.yml
   trunk/tools/ci/
   trunk/tools/ci/before_install.sh
   trunk/tools/ci/before_install_autotools.sh
   trunk/tools/ci/before_install_cmake.sh
   trunk/tools/ci/common.sh
   trunk/tools/ci/script.sh
   trunk/tools/ci/script_autotools.sh
   trunk/tools/ci/script_cmake.sh
Log:
Configure Travis CI for GEOS (#657)

Configurations for GCC and clang with both Autotools and CMake.
Enable IRC notifications

Contributed by Mateusz Loskot <mateusz at loskot.net>

Added: trunk/.travis.yml
===================================================================
--- trunk/.travis.yml	                        (rev 0)
+++ trunk/.travis.yml	2013-08-22 07:12:50 UTC (rev 3914)
@@ -0,0 +1,33 @@
+# .travis.yml - Travis CI service confiuration for GEOS
+#
+# Copyright (C) 2013 Mateusz Loskot <mateusz at loskot.net>
+#
+# This is free software; you can redistribute and/or modify it under
+# the terms of the GNU Lesser General Public Licence as published
+# by the Free Software Foundation. 
+# See the COPYING file for more information.
+#
+language: cpp
+
+compiler:
+    - g++
+    - clang
+
+env:
+    matrix:
+        - GEOS_TRAVIS_BUILD=autotools
+        - GEOS_TRAVIS_BUILD=cmake
+
+before_install: ./tools/ci/before_install.sh
+
+script: ./tools/ci/script.sh
+
+notifications:
+    on_success: always # [always|never|change] # default: change
+    on_failure: always # [always|never|change] # default: always
+    irc: "chat.freenode.net#postgis"
+    email:
+        recipients:
+            #- geos-devel at lists.osgeo.org # TODO: whitelist this e-mail
+            - mateusz at loskot.net
+

Added: trunk/tools/ci/before_install.sh
===================================================================
--- trunk/tools/ci/before_install.sh	                        (rev 0)
+++ trunk/tools/ci/before_install.sh	2013-08-22 07:12:50 UTC (rev 3914)
@@ -0,0 +1,18 @@
+#!/bin/bash -e
+#
+# Travis CI before_install runner for GEOS
+#
+# Copyright (c) 2013 Mateusz Loskot <mateusz at loskot.net>
+#
+# This is free software; you can redistribute and/or modify it under
+# the terms of the GNU Lesser General Public Licence as published
+# by the Free Software Foundation. 
+# See the COPYING file for more information.
+#
+source ${TRAVIS_BUILD_DIR}/tools/ci/common.sh
+
+sudo apt-get update -qq
+
+before_install="${TRAVIS_BUILD_DIR}/tools/ci/before_install_${GEOS_TRAVIS_BUILD}.sh"
+[ -x ${before_install} ] && ${before_install} || echo "nothing to run"
+


Property changes on: trunk/tools/ci/before_install.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tools/ci/before_install_autotools.sh
===================================================================
--- trunk/tools/ci/before_install_autotools.sh	                        (rev 0)
+++ trunk/tools/ci/before_install_autotools.sh	2013-08-22 07:12:50 UTC (rev 3914)
@@ -0,0 +1,14 @@
+#!/bin/bash -e
+#
+# Travis CI before_install for GEOS build with GNU Autotools
+#
+# Copyright (C) 2013 Mateusz Loskot <mateusz at loskot.net>
+#
+# This is free software; you can redistribute and/or modify it under
+# the terms of the GNU Lesser General Public Licence as published
+# by the Free Software Foundation. 
+# See the COPYING file for more information.
+#
+source ${TRAVIS_BUILD_DIR}/tools/ci/common.sh
+
+sudo apt-get install -qq make


Property changes on: trunk/tools/ci/before_install_autotools.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tools/ci/before_install_cmake.sh
===================================================================
--- trunk/tools/ci/before_install_cmake.sh	                        (rev 0)
+++ trunk/tools/ci/before_install_cmake.sh	2013-08-22 07:12:50 UTC (rev 3914)
@@ -0,0 +1,14 @@
+#!/bin/bash -e
+#
+# Travis CI before_install for GEOS build with CMake
+#
+# Copyright (C) 2013 Mateusz Loskot <mateusz at loskot.net>
+#
+# This is free software; you can redistribute and/or modify it under
+# the terms of the GNU Lesser General Public Licence as published
+# by the Free Software Foundation. 
+# See the COPYING file for more information.
+#
+source ${TRAVIS_BUILD_DIR}/tools/ci/common.sh
+
+sudo apt-get install -qq cmake


Property changes on: trunk/tools/ci/before_install_cmake.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tools/ci/common.sh
===================================================================
--- trunk/tools/ci/common.sh	                        (rev 0)
+++ trunk/tools/ci/common.sh	2013-08-22 07:12:50 UTC (rev 3914)
@@ -0,0 +1,42 @@
+#!/bin/bash -e
+#
+# Common utilities for Travis CI setup for GEOS
+#
+# Copyright (c) 2013 Mateusz Loskot <mateusz at loskot.net>
+#
+# This is free software; you can redistribute and/or modify it under
+# the terms of the GNU Lesser General Public Licence as published
+# by the Free Software Foundation. 
+# See the COPYING file for more information.
+#
+if [[ "$TRAVIS" != "true" ]] ; then
+	echo "Running this script makes no sense outside of travis-ci.org"
+	exit 1
+fi
+#
+# Environment
+#
+TCI_NUMTHREADS=2
+if [[ -f /sys/devices/system/cpu/online ]]; then
+	# Calculates 1.5 times physical threads
+	TCI_NUMTHREADS=$(( ( $(cut -f 2 -d '-' /sys/devices/system/cpu/online) + 1 ) * 15 / 10  ))
+fi
+#
+# Functions
+#
+tmstamp()
+{
+    echo -n "[$(date '+%H:%M:%S')]" ;
+}
+
+run_make()
+{
+    [ $TCI_NUMTHREADS -gt 0 ] && make -j $TCI_NUMTHREADS || make 
+}
+
+run_test()
+{
+    [ -f CMakeCache.txt ] && \
+        ctest -V --output-on-failure . || \
+        make check
+}

Added: trunk/tools/ci/script.sh
===================================================================
--- trunk/tools/ci/script.sh	                        (rev 0)
+++ trunk/tools/ci/script.sh	2013-08-22 07:12:50 UTC (rev 3914)
@@ -0,0 +1,20 @@
+#!/bin/bash -e
+#
+# Travis CI script runner for GEOS
+#
+# Copyright (c) 2013 Mateusz Loskot <mateusz at loskot.net>
+#
+# This is free software; you can redistribute and/or modify it under
+# the terms of the GNU Lesser General Public Licence as published
+# by the Free Software Foundation. 
+# See the COPYING file for more information.
+#
+source ${TRAVIS_BUILD_DIR}/tools/ci/common.sh
+
+# prepare build directory
+builddir="${TRAVIS_BUILD_DIR}/_build"
+mkdir -p ${builddir}
+cd ${builddir}
+
+# build and run tests
+${TRAVIS_BUILD_DIR}/tools/ci/script_${GEOS_TRAVIS_BUILD}.sh


Property changes on: trunk/tools/ci/script.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tools/ci/script_autotools.sh
===================================================================
--- trunk/tools/ci/script_autotools.sh	                        (rev 0)
+++ trunk/tools/ci/script_autotools.sh	2013-08-22 07:12:50 UTC (rev 3914)
@@ -0,0 +1,19 @@
+#!/bin/bash -e
+#
+# Travis CI script for GEOS build with GNU Autotools
+#
+# Copyright (C) 2013 Mateusz Loskot <mateusz at loskot.net>
+#
+# This is free software; you can redistribute and/or modify it under
+# the terms of the GNU Lesser General Public Licence as published
+# by the Free Software Foundation. 
+# See the COPYING file for more information.
+#
+source ${TRAVIS_BUILD_DIR}/tools/ci/common.sh
+
+cd ${TRAVIS_BUILD_DIR}
+./autogen.sh
+cd -
+${TRAVIS_BUILD_DIR}/configure
+run_make
+run_test


Property changes on: trunk/tools/ci/script_autotools.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/tools/ci/script_cmake.sh
===================================================================
--- trunk/tools/ci/script_cmake.sh	                        (rev 0)
+++ trunk/tools/ci/script_cmake.sh	2013-08-22 07:12:50 UTC (rev 3914)
@@ -0,0 +1,16 @@
+#!/bin/bash -e
+#
+# Travis CI script for GEOS build with CMake
+#
+# Copyright (C) 2013 Mateusz Loskot <mateusz at loskot.net>
+#
+# This is free software; you can redistribute and/or modify it under
+# the terms of the GNU Lesser General Public Licence as published
+# by the Free Software Foundation. 
+# See the COPYING file for more information.
+#
+source ${TRAVIS_BUILD_DIR}/tools/ci/common.sh
+
+cmake ${TRAVIS_BUILD_DIR}
+run_make
+run_test


Property changes on: trunk/tools/ci/script_cmake.sh
___________________________________________________________________
Added: svn:executable
   + *



More information about the geos-commits mailing list