Skip to content

Commit

Permalink
add travis conf / scripts for linux+osx, thanks to pyca/cryptography …
Browse files Browse the repository at this point in the history
…project
  • Loading branch information
ThomasWaldmann committed Aug 7, 2015
1 parent 5a1c7b1 commit 4cc01cd
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 21 deletions.
57 changes: 36 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
os:
- linux
- osx
sudo: false

language: python
python:
- "3.2"
- "3.3"
- "3.4"
# command to install dependencies

cache:
directories:
- $HOME/.cache/pip

matrix:
include:
- python: 3.3
env: TOXENV=py33
- python: 3.4
env: TOXENV=py34
- language: generic
os: osx
osx_image: beta-xcode6.3
env: TOXENV=py33
- language: generic
os: osx
osx_image: beta-xcode6.3
env: TOXENV=py34

install:
- if [ '$TRAVIS_OS_NAME' = 'linux' ]; then
sudo apt-get install -y libacl1-dev;
fi
- if [ '$TRAVIS_OS_NAME' = 'osx' ]; then
brew update;
brew outdated libacl1-dev || brew upgrade libacl1-dev;
source terryfy/travis_tools.sh;
get_python_environment macpython 3.2.5 venv;
fi
- "pip install Cython"
- "pip install -e ."
# command to run tests
script: fakeroot -u py.test
- ./.travis/install.sh

script:
- ./.travis/run.sh

after_success:
- ./.travis/upload_coverage.sh

notifications:
irc:
channels:
- "irc.freenode.org#borgbackup"
use_notice: true
skip_join: true
40 changes: 40 additions & 0 deletions .travis/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash

set -e
set -x

if [[ "$(uname -s)" == 'Darwin' ]]; then
brew update || brew update

if [[ "${OPENSSL}" != "0.9.8" ]]; then
brew outdated openssl || brew upgrade openssl
fi

if which pyenv > /dev/null; then
eval "$(pyenv init -)"
fi

case "${TOXENV}" in
py33)
brew outdated pyenv || brew upgrade pyenv
pyenv install 3.3.6
pyenv global 3.3.6
;;
py34)
brew outdated pyenv || brew upgrade pyenv
pyenv install 3.4.2
pyenv global 3.4.2
;;
esac
pyenv rehash
python -m pip install --user virtualenv
brew outdated libacl1-dev || brew upgrade libacl1-dev
else
pip install virtualenv
sudo apt-get install -y libacl1-dev
fi

python -m virtualenv ~/.venv
source ~/.venv/bin/activate
pip install tox pytest codecov Cython
pip install -e .
16 changes: 16 additions & 0 deletions .travis/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e
set -x

if [[ "$(uname -s)" == "Darwin" ]]; then
eval "$(pyenv init -)"
if [[ "${OPENSSL}" != "0.9.8" ]]; then
# set our flags to use homebrew openssl
export ARCHFLAGS="-arch x86_64"
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CFLAGS="-I/usr/local/opt/openssl/include"
fi
fi
source ~/.venv/bin/activate
fakeroot -u tox
10 changes: 10 additions & 0 deletions .travis/upload_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -e
set -x

NO_COVERAGE_TOXENVS=(pep8)
if ! [[ "${NO_COVERAGE_TOXENVS[*]}" =~ "${TOXENV}" ]]; then
source ~/.venv/bin/activate
bash <(curl -s https://codecov.io/bash) -e TRAVIS_OS_NAME,TOXENV
fi

0 comments on commit 4cc01cd

Please sign in to comment.