blob: 23e856c9c9c01440fc365376a58b59f9a6713c46 [file] [log] [blame]
Wenzel Jakob3b806d42015-10-11 16:29:35 +02001language: cpp
2sudo: false
Dean Moldovan3ac12752016-07-30 00:15:01 +02003matrix:
4 include:
5 - os: linux
Jason Rhinelander024ce442016-08-14 12:31:52 -04006 env: PYTHON=2.7 CPP=11 GCC=4.8
7 addons:
8 apt:
Dean Moldovanb62a8962016-08-25 22:35:15 +02009 sources: [ubuntu-toolchain-r-test, kubuntu-backports]
10 packages: [g++-4.8, cmake]
Dean Moldovan3ac12752016-07-30 00:15:01 +020011 - os: linux
Jason Rhinelander024ce442016-08-14 12:31:52 -040012 env: PYTHON=3.5 CPP=11 GCC=4.8
13 addons:
14 apt:
Dean Moldovanb62a8962016-08-25 22:35:15 +020015 sources: [ubuntu-toolchain-r-test, kubuntu-backports, deadsnakes]
16 packages: [g++-4.8, cmake, python3.5-dev]
17 - sudo: true
18 services: docker
19 env: PYTHON=2.7 CPP=14 GCC=6
20 - sudo: true
21 services: docker
22 env: PYTHON=3.5 CPP=14 GCC=6
Dean Moldovan3ac12752016-07-30 00:15:01 +020023 - os: osx
24 osx_image: xcode7.3
Dean Moldovanb62a8962016-08-25 22:35:15 +020025 env: PYTHON=2.7 CPP=14 CLANG
Dean Moldovan3ac12752016-07-30 00:15:01 +020026 - os: osx
27 osx_image: xcode7.3
Dean Moldovanb62a8962016-08-25 22:35:15 +020028 env: PYTHON=3.5 CPP=14 CLANG
29 # A barebones build makes sure everything still works without optional deps (numpy/scipy/eigen)
30 # and also tests the automatic discovery functions in CMake (Python version, C++ standard).
31 - os: linux
32 env: BAREBONES
33 addons:
34 apt:
35 sources: [ubuntu-toolchain-r-test, kubuntu-backports]
36 packages: [g++-4.8, cmake]
Jason Rhinelanderdd3d56a2016-08-26 17:11:40 -040037 install: pip install pytest
Jason Rhinelander4b5058d2016-08-17 09:14:22 -040038 # Documentation build:
39 - os: linux
40 language: docs
Jason Rhinelanderac427892016-08-28 13:00:44 -040041 env: DOCS STYLE
Jason Rhinelander0b952cd2016-08-17 14:19:08 -040042 install: pip install sphinx sphinx_rtd_theme
Jason Rhinelanderac427892016-08-28 13:00:44 -040043 script:
44 - make -C docs html SPHINX_OPTIONS=-W
45 - tools/check-style.sh
Wenzel Jakoba40c27e2016-01-21 19:21:59 +010046cache:
47 directories:
48 - $HOME/.cache/pip
Dean Moldovan14bd10d2016-08-26 11:53:25 +020049 - $HOME/Library/Caches/pip
Jason Rhinelander024ce442016-08-14 12:31:52 -040050before_install:
51- |
Dean Moldovanb62a8962016-08-25 22:35:15 +020052 # Configure build variables
53 if [ "$TRAVIS_OS_NAME" = "linux" ]; then
54 if [ -z "$GCC" ]; then export GCC=4.8; fi
55 export CXX=g++-$GCC CC=gcc-$GCC;
56 if [ "$GCC" = "6" ]; then export DOCKER=debian:testing CXX=g++ CC=gcc; fi
57 elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
58 export CXX=clang++ CC=clang;
59 fi
60 if [ -n "$CPP" ]; then export CPP=-std=c++$CPP; fi
61 if [ "${PYTHON:0:1}" = "3" ]; then export PY=3; fi
62- |
63 # Initialize enviornment
Jason Rhinelander024ce442016-08-14 12:31:52 -040064 if [ -n "$DOCKER" ]; then
65 docker pull $DOCKER
66 export containerid=$(docker run --detach --tty \
67 --volume="$PWD":/pybind11 --workdir=/pybind11 \
68 --env="CC=$CC" --env="CXX=$CXX" --env="DEBIAN_FRONTEND=$DEBIAN_FRONTEND" \
69 --env=GCC_COLORS=\ \
70 $DOCKER)
71 docker exec --tty "$containerid" apt-get update
72 docker exec --tty "$containerid" apt-get -y upgrade
73 export SCRIPT_RUN_PREFIX="docker exec --tty $containerid"
Dean Moldovanb62a8962016-08-25 22:35:15 +020074 else
Jason Rhinelander024ce442016-08-14 12:31:52 -040075 if [ "$TRAVIS_OS_NAME" = "linux" ]; then
Jason Rhinelander024ce442016-08-14 12:31:52 -040076 pip install --user --upgrade pip virtualenv
77 virtualenv -p python$PYTHON venv
78 elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
Dean Moldovanb62a8962016-08-25 22:35:15 +020079 if [ "$PY" = "3" ]; then
80 brew update; brew install python$PY;
Jason Rhinelander024ce442016-08-14 12:31:52 -040081 else
82 curl -fsSL -O https://bootstrap.pypa.io/get-pip.py
83 sudo -H python get-pip.py
84 fi
Dean Moldovanb62a8962016-08-25 22:35:15 +020085 pip$PY install --user --upgrade pip virtualenv
86 python$PY -m virtualenv venv
Dean Moldovan880a7e42016-08-02 00:42:07 +020087 fi
Jason Rhinelander024ce442016-08-14 12:31:52 -040088 source venv/bin/activate
Jason Rhinelander4b5058d2016-08-17 09:14:22 -040089 fi
Jason Rhinelander0b952cd2016-08-17 14:19:08 -040090install:
Jason Rhinelander4b5058d2016-08-17 09:14:22 -040091- |
Dean Moldovanb62a8962016-08-25 22:35:15 +020092 # Install dependencies
93 if [ -n "$DOCKER" ]; then
94 docker exec --tty "$containerid" apt-get -y --no-install-recommends install \
Jason Rhinelanderdd3d56a2016-08-26 17:11:40 -040095 python$PYTHON-dev python$PY-pytest python$PY-scipy \
Dean Moldovanb62a8962016-08-25 22:35:15 +020096 libeigen3-dev cmake make g++
97 else
Jason Rhinelanderdd3d56a2016-08-26 17:11:40 -040098 pip install numpy scipy pytest
Jason Rhinelander024ce442016-08-14 12:31:52 -040099
Dean Moldovanb62a8962016-08-25 22:35:15 +0200100 wget -q -O eigen.tar.gz https://bitbucket.org/eigen/eigen/get/3.2.9.tar.gz
101 tar xzf eigen.tar.gz
102 export CMAKE_EXTRA_ARGS="${CMAKE_EXTRA_ARGS} -DCMAKE_INCLUDE_PATH=$PWD/eigen-eigen-dc6cfdf9bcec"
103 fi
Dean Moldovan3ac12752016-07-30 00:15:01 +0200104script:
Dean Moldovan00a30092016-08-15 13:41:44 +0200105- $SCRIPT_RUN_PREFIX cmake ${CMAKE_EXTRA_ARGS}
106 -DPYBIND11_PYTHON_VERSION=$PYTHON
Dean Moldovanb62a8962016-08-25 22:35:15 +0200107 -DPYBIND11_CPP_STANDARD=$CPP
Dean Moldovan00a30092016-08-15 13:41:44 +0200108 -DPYBIND11_WERROR=ON
Dean Moldovana0c1ccf2016-08-12 13:50:00 +0200109- $SCRIPT_RUN_PREFIX make pytest -j 2
Jason Rhinelander024ce442016-08-14 12:31:52 -0400110after_script:
111- if [ -n "$DOCKER" ]; then docker stop "$containerid"; docker rm "$containerid"; fi