This repository has been archived by the owner on Apr 10, 2021. It is now read-only.
forked from pytest-dev/pytest-django
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
80 lines (67 loc) · 2.17 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
sudo: false
language: python
dist: trusty
matrix:
fast_finish: true
include:
- python: 3.6
env: TOXENV=py36-djmaster-postgres
- python: 3.6
env: TOXENV=py36-dj20-postgres
- python: 3.6
env: TOXENV=py36-dj111-sqlite
- python: 3.5
env: TOXENV=py35-dj110-postgres
- python: 3.4
env: TOXENV=py34-dj19-sqlite_file
- python: 2.7
env: TOXENV=py27-dj111-mysql_innodb
- python: 2.7
env: TOXENV=py27-dj111-mysql_myisam
- python: 2.7
env: TOXENV=py27-dj18-postgres
# pypy/pypy3: not included with coverage reports (much slower then).
- python: pypy
env: TOXENV=pypy-dj111-sqlite_file
- python: pypy3
env: TOXENV=pypy3-dj110-sqlite
- python: 3.6
env: TOXENV=checkqa
allow_failures:
- env: TOXENV=py36-djmaster-postgres
install:
# Create pip wrapper script, using travis_retry (a function) and
# inject it into tox.ini.
- mkdir -p bin
- PATH=$PWD/bin:$PATH
- printf '#!/bin/sh\n' > bin/travis_retry_pip
- declare -f travis_retry >> bin/travis_retry_pip
- printf '\necho "Using pip-wrapper.." >&2\ntravis_retry pip "$@"' >> bin/travis_retry_pip
- chmod +x bin/travis_retry_pip
- sed -i.bak 's/^\[testenv\]/\0\nwhitelist_externals = travis_retry_pip\ninstall_command = travis_retry_pip install {opts} {packages}/' tox.ini
- if diff tox.ini tox.ini.bak; then exit 1; fi
- pip install tox==2.9.1
- |
# Setup coverage tracking, but not with "checkqa" nor "pypy*".
if [[ "$TOXENV" != "checkqa" ]] && [[ "${TOXENV#pypy}" == "$TOXENV" ]]; then
PYTEST_DJANGO_COVERAGE=1
export PYTEST_ADDOPTS='--cov=pytest_django --cov=tests --cov=pytest_django_test --cov-report=term-missing:skip-covered'
export _PYTESTDJANGO_TOX_EXTRA_DEPS=pytest-cov
else
PYTEST_DJANGO_COVERAGE=0
fi
script:
- tox
after_success:
- |
set -ex
if [[ "$PYTEST_DJANGO_COVERAGE" = 1 ]]; then
pip install codecov
coverage --version
coverage combine
coverage xml
codecov_flags=${TOXENV//./}
codecov_flags=${codecov_flags//-/ }
codecov --required -X search gcov pycov -f coverage.xml --flags $codecov_flags
fi
set +x