Fetching contributors…
Cannot retrieve contributors at this time
95 lines (87 sloc) 3.53 KB
sudo: false
language: python
matrix:
allow_failures:
- env: TOXENV=py27-djangomaster
- env: TOXENV=py34-djangomaster
python:
- "3.4"
env:
global:
- PIP_DISABLE_PIP_VERSION_CHECK=true
matrix:
- TOXENV=py27-django14
- TOXENV=py27-django15
- TOXENV=py27-django16
- TOXENV=py27-django17
- TOXENV=py27-django18
- TOXENV=py27-djangomaster
- TOXENV=py34-django15
- TOXENV=py34-django16
- TOXENV=py34-django17
- TOXENV=py34-django18
- TOXENV=py34-djangomaster
- TOXENV=checkqa-python2
- TOXENV=checkqa
install:
# Create pip wrapper script, using travis_retry (a function) and
# inject it into tox.ini.
- mkdir -p bin
- PATH=$PWD/bin:$PATH
- PIP_INSTALL=bin/travis_pip_install
- printf '#!/bin/bash -x\n' > $PIP_INSTALL
- declare -f travis_retry >> $PIP_INSTALL
- printf '\necho "=====\nUsing pip-wrapper for \"$@\"\n=====\n" >&2\n' >> $PIP_INSTALL
# Handle "pip install -e" for usedevelop from tox.
- printf '\nif [ "$1" = "-e" ]; then pip install "$@"; exit $?; fi\n' >> $PIP_INSTALL
# First try to install from wheelhouse.
- printf 'for i in "$@"; do pip install --no-index --find-links=${PIP_WHEELHOUSE} "$i"; done\n' >> $PIP_INSTALL
# Then upgrade in case of outdated wheelhouse.
- printf 'for i in "$@"; do travis_retry pip install --upgrade "$i"; done\n' >> $PIP_INSTALL
# ..and add the new/current wheels.
- printf 'pip wheel --wheel-dir=${PIP_WHEELHOUSE} --find-links=${PIP_WHEELHOUSE} "$@"\n' >> $PIP_INSTALL
- chmod +x $PIP_INSTALL
# Adjust tox.ini.
- sed -i.bak 's/^\[testenv\]/\0\ninstall_command = travis_pip_install {opts} {packages}/' tox.ini
- diff tox.ini tox.ini.bak && { echo "tox.ini was not changed."; return 1; } || true
- sed -i.bak 's/whitelist_externals =/\0\n travis_pip_install/' tox.ini
- diff tox.ini tox.ini.bak && { echo "tox.ini was not changed."; return 1; } || true
# Inject wheel dependency into tox.ini, for travis_pip_install.
- sed -i.bak -e 's/deps =.*/\0\n wheel/' tox.ini
- diff tox.ini tox.ini.bak && { echo "tox.ini was not changed."; return 1; } || true
# Conditionally inject postgres dependency and DSM setting into tox.ini.
- if [ "$USE_POSTGRES" = 1 ]; then sed -i.bak -e 's/deps =/\0\n psycopg2/' -e 's/DJANGO_SETTINGS_MODULE=test_project.settings/\0_postgres/' tox.ini && diff tox.ini tox.ini.bak && { echo "tox.ini was not changed."; return 1; } || true; fi
- cat $PIP_INSTALL
- cat tox.ini
# Create wheels (skips existing ones from the cached wheelhouse).
- export PIP_WHEELHOUSE=$PWD/wheelhouse
- travis_pip_install tox
- if [ -n "$EXTRAREQ" ]; then travis_pip_install $EXTRAREQ; fi
- pip freeze
before_script:
- RUN_TESTS="tox -- rules_light"
# Run tests either with or without coverage (being installed).
- command -v coveralls && RUN_TESTS="$RUN_TESTS --cov" || true
before_install:
- npm install phantomjs
- phantomjs --version
script:
- ls -l $PWD/wheelhouse > /tmp/wheelhouse.before
- $RUN_TESTS
- ls -l $PWD/wheelhouse > /tmp/wheelhouse.after
- diff /tmp/wheelhouse.before /tmp/wheelhouse.after || true
- test -d .tox/$TOXENV/log && cat .tox/$TOXENV/log/*.log || true
after_success:
- command -v coveralls && { coveralls; return $?; } || true
notifications:
irc:
channels:
- "irc.freenode.org#yourlabs"
template:
- "%{repository} (%{commit} %{author}) : %{message} %{build_url} %{compare_url}"
# Persistent cache across builds (http://docs.travis-ci.com/user/caching/).
cache:
directories:
- $PWD/wheelhouse
before_cache:
- rm -f .tox/$TOXENV/log/*.log