forked from yourlabs/django-autocomplete-light
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
99 lines (92 loc) · 3.56 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
sudo: false
language: python
matrix:
allow_failures:
- env: TOXENV=py27-djangomaster
- env: TOXENV=py34-djangomaster
python:
- "3.4"
env:
global:
- TESTS_SKIP_LIVESERVER=1
- TESTS_WEBDRIVER=PhantomJS
- PIP_DISABLE_PIP_VERSION_CHECK=true
matrix:
- TOXENV=py27-django14-taggit-genericm2m
- TOXENV=py27-django15-taggit-genericm2m
- TOXENV=py27-django16-taggit-genericm2m
- TOXENV=py27-django17-taggit-genericm2m
- TOXENV=py27-django18-taggit-genericm2m-postgresql
- TOXENV=py27-django18-taggit-genericm2m-mysql
- TOXENV=pypy-djangostable
# Current stable Django.
- TOXENV=py27-django18
- TOXENV=py27-django18-taggit
- TOXENV=py27-django18-taggit-genericm2m TESTS_SKIP_LIVESERVER= EXTRAREQ="pytest-cov"
- TOXENV=py27-django18-genericm2m
- TOXENV=py27-djangomaster
- TOXENV=py34-django15-taggit-genericm2m
- TOXENV=py34-django16-taggit-genericm2m
- TOXENV=py34-django17-taggit-genericm2m
# Current stable Django.
- TOXENV=py34-django18
- TOXENV=py34-django18-taggit
- TOXENV=py34-django18-taggit-genericm2m TESTS_SKIP_LIVESERVER= EXTRAREQ="pytest-cov"
- TOXENV=py34-django18-genericm2m
- 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\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
# Install using "pip install".
- printf "pip install \"\$@\"\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
- cat tox.ini
- travis_pip_install tox
- if [ -n "$EXTRAREQ" ]; then travis_pip_install $EXTRAREQ; fi
- pip freeze
before_script:
- if echo "$TOXENV" | grep mysql; then mysql -e 'create database autocomplete_light_test;'; fi
- if echo "$TOXENV" | grep postgresql; then psql -c 'create database autocomplete_light_test;' -U postgres; fi
- RUN_TESTS="tox -- autocomplete_light"
# Run tests either with or without coverage (being installed).
- command -v coveralls && RUN_TESTS="$RUN_TESTS --cov" || true
before_install:
# Upgrade pip to 7.x for automatic installing from wheels.
- travis_retry pip install 'pip>7'
- travis_retry npm install phantomjs
- phantomjs --version
script:
- find $HOME/.cache/pip -ls > /tmp/wheelhouse.before
- $RUN_TESTS
- find $HOME/.cache/pip -ls > /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:
- $HOME/.cache/pip
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log