Skip to content

Commit

Permalink
add travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
gregoryyoung committed Mar 9, 2016
1 parent 145611a commit 018044f
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 1 deletion.
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Travis CI script
language: c

os:
- linux

sudo: false

services:
- docker

env:
- BUILD_TYPE=default
#- BUILD_TYPE=android
#- BUILD_TYPE=check-py
#- BUILD_TYPE=cmake

addons:
apt:
packages:
- valgrind
- git

before_install:
- if [ $TRAVIS_OS_NAME == "osx" ] ; then brew update; brew install binutils valgrind ; fi

# Hand off to generated script for each BUILD_TYPE
script: ./ci_build.sh
17 changes: 17 additions & 0 deletions builds/check_zproject/ci_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -ex

docker run -v "$REPO_DIR":/gsl zeromqorg/zproject project.xml

# keep an eye on git version used by CI
git --version
if [[ $(git --no-pager diff -w) ]]; then
git --no-pager diff -w
echo "There are diffs between current code and code generated by zproject!"
exit 1
fi
if [[ $(git status -s) ]]; then
git status -s
echo "zproject generated new files!"
exit 1
fi
16 changes: 16 additions & 0 deletions builds/check_zproto/ci_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
set -ex


# keep an eye on git version used by CI
git --version
if [[ $(git --no-pager diff -w api/*) ]]; then
git --no-pager diff -w api/*
echo "There are diffs between current code and code generated by zproto!"
exit 1
fi
if [[ $(git status -s api) ]]; then
git status -s api
echo "zproto generated new files!"
exit 1
fi
71 changes: 71 additions & 0 deletions ci_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/usr/bin/env bash

################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# PLEASE REFER TO THE README FOR INFORMATION ABOUT MAKING PERMANENT CHANGES. #
################################################################################

set -x
set -e

if [ "$BUILD_TYPE" == "default" ]; then
mkdir tmp
BUILD_PREFIX=$PWD/tmp

CONFIG_OPTS=()
CONFIG_OPTS+=("CFLAGS=-I${BUILD_PREFIX}/include")
CONFIG_OPTS+=("CPPFLAGS=-I${BUILD_PREFIX}/include")
CONFIG_OPTS+=("CXXFLAGS=-I${BUILD_PREFIX}/include")
CONFIG_OPTS+=("LDFLAGS=-L${BUILD_PREFIX}/lib")
CONFIG_OPTS+=("PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig")
CONFIG_OPTS+=("--prefix=${BUILD_PREFIX}")
CONFIG_OPTS+=("--with-docs=no")
CONFIG_OPTS+=("--quiet")

# Clone and build dependencies
git clone --quiet --depth 1 https://github.com/zeromq/libzmq libzmq
cd libzmq
git --no-pager log --oneline -n1
if [ -e autogen.sh ]; then
./autogen.sh 2> /dev/null
fi
if [ -e buildconf ]; then
./buildconf 2> /dev/null
fi
./configure "${CONFIG_OPTS[@]}"
make -j4
make install
cd ..
git clone --quiet --depth 1 https://github.com/zeromq/czmq czmq
cd czmq
git --no-pager log --oneline -n1
if [ -e autogen.sh ]; then
./autogen.sh 2> /dev/null
fi
if [ -e buildconf ]; then
./buildconf 2> /dev/null
fi
./configure "${CONFIG_OPTS[@]}"
make -j4
make install
cd ..

# Build and check this project
./autogen.sh 2> /dev/null
./configure "${CONFIG_OPTS[@]}"
make -j4
make check
make memcheck
make install

# Build and check this project without DRAFT APIs
make clean
git reset --hard HEAD
./autogen.sh 2> /dev/null
./configure --enable-drafts=no "${CONFIG_OPTS[@]}"
make -j4
make check
make install
else
pushd "./builds/${BUILD_TYPE}" && REPO_DIR="$(dirs -l +1)" ./ci_build.sh
fi
3 changes: 2 additions & 1 deletion project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
script = "zproject.gsl"
prefix = "es"
header = "esclient.h">
<version major = "0" minor="1" patch="0"/>
<version major = "0" minor="1" patch= "0"/>
<include filename = "license.xml" />
<target name = "travis" />
<use project = "czmq" />
<class name = "es_connection" />
<main name = "es_client_tests" />
Expand Down

0 comments on commit 018044f

Please sign in to comment.