forked from aio-libs-abandoned/aioredis-py
/
.travis.yml
93 lines (81 loc) · 1.98 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
sudo: false
addons:
apt:
packages:
- socat
language: python
python:
- "3.3"
- "3.4"
- "3.5"
env:
# global:
# - ALL_REDIS_TAGS="2.6.17 2.8.22 3.0.5 3.2.0"
matrix:
- REDIS_TAG=2.6.17
- REDIS_TAG=2.8.22
- REDIS_TAG=3.0.5
- REDIS_TAG=3.2.0
cache:
directories:
- $HOME/redis
- $HOME/.cache/pip
before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
before_install:
- export REDIS_BIN=$HOME/redis/${REDIS_TAG}/bin
- >
if [ ! -x "$REDIS_BIN/redis-server" ]; then
# For proper caching we must build all redis versions
wget -c https://github.com/antirez/redis/archive/${REDIS_TAG}.tar.gz -O redis-${REDIS_TAG}.tar.gz
tar -xvf redis-${REDIS_TAG}.tar.gz
make -C redis-${REDIS_TAG} PREFIX=$HOME/redis/${REDIS_TAG} install
fi
# make certificate for ssl/tls test
- make certificate CERT_DIR=/tmp/certs/
install:
- pip install hiredis
- pip install flake8
- pip install "pytest>=2.9.1"
- pip install pytest-cov
- pip install coveralls
- pip install -e .
before_script:
- >
$REDIS_BIN/redis-server --daemonize yes
--pidfile ./redis-server.pid
--unixsocket /tmp/aioredis.sock
--port 6379
--save ""
- sleep 3
- export REDIS_VERSION="$(redis-cli INFO SERVER | sed -n 2p)"
- echo $REDIS_VERSION
script:
- >
if python -c "import sys; sys.exit(sys.version_info < (3, 5))"; then
flake8 aioredis tests
else
flake8 --exclude=py35_* aioredis tests
fi;
- py.test -rsxX --cov --redis-server=${REDIS_BIN}/redis-server --ssl-cafile=/tmp/certs/test.crt
# checking examples
- >
if python -c "import sys; sys.exit(sys.version_info < (3, 5))"; then
export EXAMPLES=$(find $PWD/examples/ -name "*.py");
else
export EXAMPLES=$(find $PWD/examples/ -name "*.py" -not -name "*_3.5_*.py");
fi;
for example in $EXAMPLES; do
echo "Running ${example}";
python3 ${example} || exit 1;
done;
after_script:
- coveralls
# deploy:
# provider: pypi
# user: popravich
# password:
# distributions: "sdist bdist_wheel"
# on:
# tags: true
# python: "3.5"