forked from themoos/python-moos
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
95 lines (86 loc) · 2.7 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
language: cpp
matrix:
include:
- os: linux
env: PYTHON=2.7
- os: linux
env: PYTHON=3.6
- os: linux
env: CONDA=2.7
- os: linux
env: CONDA=3.7
- os: osx
env: PYTHON=2.7
- os: osx
env: BREW=3.7
- os: osx
env: CONDA=2.7
- os: osx
env: CONDA=3.7
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- deadsnakes
- kubuntu-backports
packages:
- g++-4.8
- python3.6
- python3.6-dev
- cmake
before_install:
- if [ "`uname`" != "Darwin" ] ; then export MOOS_CXX_FLAGS="-fPIC -Wno-long-long"; fi
- if [ "`uname`" != "Darwin" ] ; then export CXX="g++-4.8"; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX=g++-4.8 CC=gcc-4.8; fi
- |
cd ..
git clone --depth=1 https://github.com/themoos/core-moos
cd core-moos
mkdir build
cd build
cmake -DENABLE_EXPORT=ON -DUSE_ASYNC_COMMS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=$MOOS_CXX_FLAGS ..
cmake --build . --config Release --config -j4
sudo cmake --build . --config Release --target install
cd $TRAVIS_BUILD_DIR
- |
if [ -n "$PYTHON" ]; then
export CI_PY=python$PYTHON
# this is required because ubuntu's python/pip is very broken
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo $CI_PY
$CI_PY -m pip install --user --upgrade virtualenv
$CI_PY -m virtualenv -p python$PYTHON venv
fi
- |
if [ -n "$BREW" ]; then
brew update; brew install python; brew upgrade python
$(brew --prefix python)/bin/python$BREW -m pip install --user --upgrade virtualenv
$(brew --prefix python)/bin/python$BREW -m virtualenv venv
fi
- |
if [ -n "$CONDA" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then OS=Linux-x86_64; else OS=MacOSX-x86_64; fi
wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda${CONDA:0:1}-latest-$OS.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda update -q conda
conda install -q conda-build
conda create -q -n ci-build python=$CONDA
fi
install:
- |
if [ -n "$PYTHON" ] || [ -n "$BREW" ]; then
source venv/bin/activate
python --version && which python
python setup.py sdist
pip install --verbose dist/*.tar.gz
elif [ -n "$CONDA" ]; then
conda activate ci-build
conda build conda.recipe
conda install --use-local pymoos
fi
script:
- python --version && which python
- python tests/test.py