From 59d6add7d268b6252ee207db3378a72f5fb1bca5 Mon Sep 17 00:00:00 2001 From: Kyle Manna Date: Sun, 20 Sep 2015 21:49:48 -0700 Subject: travis-ci: Initial working build * Initial working build for Travis CI build system. --- .travis.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..5848c424 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,28 @@ +language: c + +compiler: + - gcc + - clang + +before_install: + - export PATH=$HOME/.local/bin:$HOME/protobuf/bin:$PATH + - export MAKEFLAGS=-j$(grep processor /proc/cpuinfo | wc -l) + - $CC --version + - python --version + - lsb_release -a + +cache: + directories: + - $HOME/protobuf +install: + - pip install --user protobuf + - test \! -d $HOME/protobuf + && curl -L https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.bz2 | tar xjf - + && pushd protobuf-2.6.1 + && ./configure --prefix=$HOME/protobuf && make && make install + && popd + || true # True if test is false as the cache exists + +script: + - pushd generator/proto && make && popd + - pushd tests && scons && popd -- cgit 1.2.3-korg From 47bd244f2e7772c2259f2c37ddf9480959c2272a Mon Sep 17 00:00:00 2001 From: Kyle Manna Date: Sun, 20 Sep 2015 22:58:54 -0700 Subject: travis-ci: Build C/C++/Python matrix * Test a number of C compilers * Travis CI can't handle three languages (C, C++, Python) * Add support for swapping python2/3 binaries * Scons has made no attempts to support python3 yet: * Build the matrix manually * Scons doesn't inherit $CC/$CXX from parent environement, so pass compiler flags directly --- .travis.yml | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5848c424..6b8db516 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,49 @@ -language: c +# Travis CI has no ability to handle 3 langauges (c, c++, python) +# and it overrides $CC/$CXX if language is set to c/c++ (only one, not both). +# +# Set language to python since at least the result of that is something useful. +language: python + +python: + - "2.7" + - "3.4" + +# Manage the C/C++ compiler manually +env: + - CC=gcc CXX=g++ + - CC=gcc-4.8 CXX=g++-4.8 + - CC=gcc-4.9 CXX=g++-4.9 + - CC=gcc-5 CXX=g++-5 + - CC=clang CXX=clang++ + +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-4.8 + - g++-4.8 + - gcc-4.9 + - g++-4.9 + - gcc-5 + - g++-5 -compiler: - - gcc - - clang before_install: - export PATH=$HOME/.local/bin:$HOME/protobuf/bin:$PATH - export MAKEFLAGS=-j$(grep processor /proc/cpuinfo | wc -l) - $CC --version + - $CXX --version - python --version - lsb_release -a -cache: - directories: - - $HOME/protobuf +# Seems to be issues with concurrent builds +#cache: +# directories: +# - $HOME/protobuf + install: - - pip install --user protobuf + - pip install protobuf - test \! -d $HOME/protobuf && curl -L https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.bz2 | tar xjf - && pushd protobuf-2.6.1 @@ -23,6 +51,6 @@ install: && popd || true # True if test is false as the cache exists -script: +script: - pushd generator/proto && make && popd - - pushd tests && scons && popd + - pushd tests && python2 $(which scons) CC=$CC CXX=$CXX && popd -- cgit 1.2.3-korg From 77dad2e4e271ccafa618619e23b81480542f9832 Mon Sep 17 00:00:00 2001 From: Kyle Manna Date: Mon, 21 Sep 2015 09:04:11 -0700 Subject: travis-ci: Use protobuf v3 as it adds python3 * Still in testing currently. --- .travis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6b8db516..2e77e7c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,13 +43,11 @@ before_install: # - $HOME/protobuf install: - - pip install protobuf - - test \! -d $HOME/protobuf - && curl -L https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.bz2 | tar xjf - - && pushd protobuf-2.6.1 + - curl -L https://github.com/google/protobuf/releases/download/v3.0.0-beta-1/protobuf-python-3.0.0-alpha-4.tar.gz | tar xzf - + && pushd protobuf-3.0.0-alpha-4 && ./configure --prefix=$HOME/protobuf && make && make install + && pushd python && python setup.py build && python setup.py install && popd && popd - || true # True if test is false as the cache exists script: - pushd generator/proto && make && popd -- cgit 1.2.3-korg