forked from nanopb/nanopb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
1 changed file
with
38 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,56 @@ | ||
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 | ||
&& ./configure --prefix=$HOME/protobuf && make && make 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 |