From c46113823e5bde62ef5a1ff53ec26d954b3ff53e Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Tue, 25 Apr 2017 17:21:38 +0200 Subject: added CI on Travis --- .travis.yml | 14 ++++++++++++++ dist/travis/before_script.sh | 30 ++++++++++++++++++++++++++++++ dist/travis/script.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+) create mode 100644 .travis.yml create mode 100644 dist/travis/before_script.sh create mode 100644 dist/travis/script.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b40cbbf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: cpp +os: +- linux +- osx +dist: trusty +compiler: +- clang +- gcc +sudo: required +before_install: +- chmod +x dist/travis/*.sh +- dist/travis/before_script.sh +script: +- dist/travis/script.sh diff --git a/dist/travis/before_script.sh b/dist/travis/before_script.sh new file mode 100644 index 0000000..7538bb5 --- /dev/null +++ b/dist/travis/before_script.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +OS=$(uname -s) + +case $OS in + Linux) + sudo apt-get update -qq + sudo apt-get install -y \ + cmake \ + libssh-dev + ;; + + Darwin) + brew update + brew install \ + cmake \ + libssh \ + gettext \ + || true + # make sure cmake finds the brew version of gettext + brew link --force gettext || true + ;; + + *) + echo "ERROR: unknown operating system '$OS'." + ;; +esac + diff --git a/dist/travis/script.sh b/dist/travis/script.sh new file mode 100644 index 0000000..55c6890 --- /dev/null +++ b/dist/travis/script.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +set -e + +OS=$(uname -s) + +case $OS in + Linux) + mkdir build + cd build + cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release \ + -DLIB_INSTALL_DIR=lib -DCMAKE_CXX_FLAGS=-g \ + .. + make VERBOSE=1 + make VERBOSE=1 test + sudo make VERBOSE=1 install + cd .. + ;; + + Darwin) + # forcing brew versions (of gettext) over Mac versions + export CFLAGS=-I/usr/local + export CXXFLAGS=-I/usr/local + export LDFLAGS=-L/usr/local/lib + mkdir build + cd build + cmake \ + -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_FLAGS=-g -G Xcode \ + .. + xcodebuild -configuration Release -target ALL_BUILD + xcodebuild -configuration Release -target RUN_TESTS + sudo xcodebuild -configuration Release -target install + cd .. + ;; + + *) + echo "ERROR: unknown operating system '$OS'." + ;; +esac + -- cgit v1.2.3-54-g00ecf