From 103a6c56e494a457a6e6ca2de78d4db398da20dd Mon Sep 17 00:00:00 2001 From: Takatoshi Kondo Date: Mon, 8 Sep 2014 16:38:44 +0900 Subject: [PATCH] Added travis-ci support. --- .travis.yml | 26 +++++++++++++++++++++++ README.md | 2 ++ ci/build_autotools.sh | 39 +++++++++++++++++++++++++++++++++++ ci/build_cmake.sh | 48 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 .travis.yml create mode 100755 ci/build_autotools.sh create mode 100755 ci/build_cmake.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..520cffce --- /dev/null +++ b/.travis.yml @@ -0,0 +1,26 @@ +language: cpp +cache: + - apt +compiler: + - clang + - gcc +before_install: +# We need this line to have g++4.8 available in apt + - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test + - sudo apt-get update -qq + - sudo apt-get update + - sudo apt-get install libgtest-dev + - "cd /usr/src/gtest && sudo cmake . && sudo cmake --build . && sudo mv libg* /usr/local/lib/ ; cd -" +install: + - sudo apt-get install -qq gcc-4.8 g++-4.8 +# We want to compile with g++ 4.8 when rather than the default g++ + - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90 + +env: + - ACTION="ci/build_autotools.sh" PARAM="cpp11" + - ACTION="ci/build_autotools.sh" PARAM="cpp03" + - ACTION="ci/build_cmake.sh" PARAM="cpp11" + - ACTION="ci/build_cmake.sh" PARAM="cpp03" + +script: + - git clean -xdf && ${ACTION} ${PARAM} diff --git a/README.md b/README.md index 0f162c82..4436fcf1 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ The source for msgpack-c is held at [msgpack-c](https://github.com/msgpack/msgpa To report an issue, use the [msgpack-c issue tracker](https://github.com/msgpack/msgpack-c/issues) at github.com. +## Version +0.6.0 [![Build Status](https://travis-ci.org/msgpack/msgpack-c.svg?branch=poc/0.6)](https://travis-ci.org/msgpack/msgpack-c) ## Using Msgpack diff --git a/ci/build_autotools.sh b/ci/build_autotools.sh new file mode 100755 index 00000000..90cfd504 --- /dev/null +++ b/ci/build_autotools.sh @@ -0,0 +1,39 @@ +#!/bin/sh + +./bootstrap +ret=$? +if [ $ret -ne 0 ] +then + exit $ret +fi + +if [ $1 = "cpp11" ] +then + ./configure CXXFLAGS="-std=c++11" +else + ./configure +fi + +ret=$? +if [ $ret -ne 0 ] +then + exit $ret +fi + +make + +ret=$? +if [ $ret -ne 0 ] +then + exit $ret +fi + +make check + +ret=$? +if [ $ret -ne 0 ] +then + exit $ret +fi + +exit 0 diff --git a/ci/build_cmake.sh b/ci/build_cmake.sh new file mode 100755 index 00000000..92a06c7c --- /dev/null +++ b/ci/build_cmake.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +mkdir build + +ret=$? +if [ $ret -ne 0 ] +then + exit $ret +fi + +cd build + +ret=$? +if [ $ret -ne 0 ] +then + exit $ret +fi + +if [ $1 = "cpp11" ] +then + cmake -DMSGPACK_CXX11=ON .. +else + cmake .. +fi + +ret=$? +if [ $ret -ne 0 ] +then + exit $ret +fi + +make + +ret=$? +if [ $ret -ne 0 ] +then + exit $ret +fi + +make test + +ret=$? +if [ $ret -ne 0 ] +then + exit $ret +fi + +exit 0