-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
115 lines (104 loc) · 4.49 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# This script instructs the Travis CI service to build rig_cpp_key_allocation against various
# versions of Python on both Linux and Mac OS X and also deploys binary and
# source distributions of rig_cpp_key_allocation to PyPI when testing a tag.
#
# Under Linux, the googletest based test suite is executed under Valgrind to
# check for correct behaviour and lack of memory-leaks. This is not possible
# under Mac OS at present due to difficulties installing test dependencies on
# Travis' OS X image.
#
# On both Linux and OS X the module is compiled and a short Python test is run.
#
# If a Git tag is being tested, this is assumed to be for a new release of
# rig_cpp_key_allocation and so, after testing, a source distribution and
# "binary wheel" containing the compiled code is created and then uploaded to
# PyPI. Since binary wheels cannot currently be created for Linux, this process
# is only carried out on OS X. Note that though all OS X tests will attempt to
# upload a source distribution, only the first deployed will be kept. This is
# not a problem since the source distribution is identical across all
# platforms.
language: python
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
env:
# The (encrypted) password for the 'rigbots' PyPI account, used for
# deployment.
global:
# PYPIPASSWORD=...
secure: "WQEAx6rliDGGDmHhsDBsGCR+nUf4CJFWSq+6+tx4F5Z3tOE5YBLoZ+jkJWuAB5841FwrHD0Cf8Ihoxfx/1tNDj8wBlDDNE+M1tL9izakPoJGLjK6B1iBLswG8Nv7jkl4EEZQniVhsQkdLLqiw/hYjnlhMUPd5vzHC9pJAwFwEIBvfQajigkp7ENj+D+9FI5OV534XuAuoiPN45G6IhDMrdDpDa4BGp/7w9FvSzOKjUHqAqNSYnkDiS//xciRwrGbXXhYmYkS4bWqCPBV5ZusmNC9Mnr1IfsFyVeuvumWr9Tifl4L3bH/NhGLJPrvYkg8KUo8AVabQquKcpPzDysW/3C9s3ihuKDQIUa0q2nvO7+Ya1tABeENj+v6FKbUIyQ1KsO2j7pI2Sm6rHa9hz0MVIrTR999+0/qIxP8UWpM1Z2mr3pLhc4ffh3AtxieBKP7NadjPaCRcD/pXLUf0pdDGwxN9bbTkH+yvkGpHbpUPZxLsvkqbjlq1R94mRaVYx/ARvHO2hXC2vp6NuGZSCVMaItuLYF3pKMYBHrLhUwYaTMKPWkg3/aybI5hNDRgZEIs7t+pSQ/vXlxsL7C6z4iJ0GxAlIRbj9jONd2DgEUylCUs4/G+h14PrGdwN38mpH8BXIdjb1KL9tsyITYL/9Dx7TwasZLMJyeAaumYxPxCnJ8="
# When running under Linux use the container based build infrastructure
sudo: true
dist: trusty
# Run against both Linux and OS X
os:
- linux
- osx
# Install dependencies for running the test suite. Note that this is ignored on
# OS X (where test suite doesn't run either).
addons:
apt:
packages:
- valgrind
- libgtest-dev
- libffi-dev
- libboost-all-dev
# Setup the required Python version. Since Travis' (beta) OS X support does not
# yet allow easy selection of Python versions we must manually fetch, install
# and configure the Python versions we need. To make life simpler we also use
# this approach under Linux.
install:
- pip install cffi>=1.0.0 codecov
# gtest install
- cd /usr/src/gtest
- sudo cmake -DBUILD_SHARED_LIBS=ON .
- sudo make
- sudo mv libgtest* /usr/lib/
- cd "${TRAVIS_BUILD_DIR}"
# Test rig_cpp_key_allocation.
script:
# On Linux only: Compile and run the test suite under valgrind to check
# for functionality and memory leaks.
- >
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
cd tests
make
cd "${TRAVIS_BUILD_DIR}"
else
echo "Test suite disabled on OS X!";
fi
# On Linux and OS X: Make sure CFFI wrapper compiles and the package can be
# imported into Python.
- python setup.py install
- python -c "from rig_cpp_key_allocation import *"
after_success:
# Generate coverage report for Python and C++
- codecov
# Specify account details for PyPI
- echo "[distutils]" > ~/.pypirc
- echo "index-servers =" >> ~/.pypirc
- echo " pypi" >> ~/.pypirc
- echo "[pypi]" >> ~/.pypirc
- echo "repository=https://pypi.python.org/pypi" >> ~/.pypirc
- echo "username=rigbots" >> ~/.pypirc
- echo "password=$PYPIPASSWORD" >> ~/.pypirc
# For OS X and tags only, build a Python source distribution and "binary
# wheel" and upload these to PyPI. Note that the source upload will only
# succeed the first time and will be skipped by twine in subsiquent attempts.
- >
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
if [ -n "$TRAVIS_TAG" ]; then
pip install twine;
python setup.py sdist bdist_wheel;
twine upload --skip-existing dist/*;
else
echo "Not deploying as not a tagged commit."
fi
else
echo "Not deploying as not running on OS X";
fi
# No pestering!
notifications:
email: false