-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy path.travis.yml
116 lines (110 loc) · 4.73 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
language: python
env:
global:
- DJANGO_LOG_FILE="/dev/null"
matrix:
include:
- python: "2.7"
env: PROJECT=idaplugin ENV=conda
- python: "3.6"
env: PROJECT=idaplugin ENV=conda
- python: "2.7"
env: PROJECT=server ENV=data DJANGO_SETTINGS_MODULE='rematch.settings.base'
services:
- rabbitmq
- postgresql
- python: "3.6"
env: PROJECT=server ENV=data DJANGO_SETTINGS_MODULE='rematch.settings.base'
services:
- rabbitmq
- postgresql
- python: "2.7"
env: PROJECT=server ENV=docker DJANGO_SETTINGS_MODULE='rematch.settings.docker'
services:
- docker
- python: "2.7"
env: PROJECT=setup.py
- python: "3.6"
env: PROJECT=setup.py
- python: "3.6"
env: PROJECT=docs
- python: "2.7"
env: PROJECT=interop ENV=conda DJANGO_SETTINGS_MODULE='rematch.settings.base'
services:
- rabbitmq
- postgresql
branches:
only:
- master
install:
- set +vx;
- pip install --upgrade pip setuptools wheel
- if [ "${ENV}" == "docker" ]; then
service docker start ;
docker-compose -f ./${PROJECT}/docker-compose.yml build ;
docker-compose -f ./${PROJECT}/docker-compose.yml up -d ;
docker-compose -f ./${PROJECT}/docker-compose.yml exec --user root web chown -R rematch:rematch /var/log/rematch ;
docker-compose -f ./${PROJECT}/docker-compose.yml exec --user root web pip install --upgrade -r ../tests/requirements.txt ;
docker-compose -f ./${PROJECT}/docker-compose.yml exec --user root web pip install --upgrade coveralls pytest-cov ;
docker-compose -f ./${PROJECT}/docker-compose.yml logs ;
pip install --upgrade flake8 ;
fi ;
- if [ "${ENV}" == "conda" ]; then
wget "https://repo.continuum.io/miniconda/Miniconda${TRAVIS_PYTHON_VERSION:0:1}-latest-Linux-x86_64.sh" -O miniconda.sh ;
bash ./miniconda.sh -b -p "${HOME}/miniconda" ;
export PATH=${HOME}/miniconda/bin:$PATH ;
conda info -a ;
conda install --yes python=${TRAVIS_PYTHON_VERSION} pyqt ;
fi ;
- if [ "${ENV}" == "data" ]; then
pip install --upgrade --only-binary=numpy,scipy numpy scipy ;
fi ;
- if [ "${ENV}" != "docker" ]; then
if [ -f "tests/${PROJECT}/requirements.txt" ]; then
pip install --upgrade -r "tests/${PROJECT}/requirements.txt" ;
fi ;
if [ -f "${PROJECT}/requirements.txt" ]; then
pip install --upgrade -r "${PROJECT}/requirements.txt" ;
fi ;
pip install --upgrade flake8 coveralls pytest-cov ;
fi ;
- if [ "${PROJECT}" == "interop" ] ; then
pip install --upgrade -r server/requirements.txt ;
fi ;
- if [ "${PROJECT}" == "server" ] || [ "${PROJECT}" == "interop" ] ; then
export POSTGRES_HOST=localhost ;
export POSTGRES_USER=postgres ;
export POSTGRES_PASSWORD= ;
export RABBITMQ_HOST=localhost ;
export RABBITMQ_DEFAULT_USER=guest ;
export RABBITMQ_DEFAULT_PASS=guest ;
fi ;
script:
- flake8 ./${PROJECT} --show-source --statistics
- if [ -d ./tests/${PROJECT} ]; then flake8 ./tests/${PROJECT} --show-source --statistics ; fi ;
- if [ -d ./tests/${PROJECT} ]; then
if [ "${ENV}" == "docker" ]; then
docker-compose -f ./${PROJECT}/docker-compose.yml exec web /bin/bash -c "cd ../ ; PYTHONPATH=. python -m pytest -rapP ./${PROJECT} ./tests/ --verbose --cov-report= --cov=${PROJECT} ;" ;
elif [ "${PROJECT}" == "interop" ]; then
PYTHONPATH=. py.test -rapP ./server ./idaplugin ./tests/${PROJECT} --verbose --cov-report= --cov=server --cov=idaplugin ;
elif [ "${PROJECT}" == "server" ]; then
PYTHONPATH=. py.test -rapP ./${PROJECT} ./tests/${PROJECT} --verbose --cov-report= --cov=${PROJECT} ;
elif [ "${PROJECT}" == "idaplugin" ] ; then
py.test -rapP ./${PROJECT} ./tests/${PROJECT} --ida-replay ./tests/idaplugin/replay_empty.json --verbose --cov-report= --cov=${PROJECT} ;
else
py.test -rapP ./${PROJECT} ./tests/${PROJECT} --verbose --cov-report= --cov=${PROJECT} ;
fi ;
fi ;
- if [ "${PROJECT}" == "setup.py" ]; then python ./setup.py server install ; fi ;
- if [ "${PROJECT}" == "setup.py" ]; then python ./setup.py idaplugin install ; fi ;
- if [ "${PROJECT}" == "docs" ]; then sphinx-build ./docs/ ./docs/_build -a -E -n -W ; fi ;
- if [ "${ENV}" == "docker" ]; then
curl -I http://127.0.0.1:8000/ ;
fi ;
after_script:
- if [ -d ./tests/${PROJECT} ] && [ "${ENV}" != "docker" ]; then
coveralls ;
fi ;
- if [ -d ./tests/${PROJECT} ] && [ "${ENV}" == "docker" ]; then
docker-compose -f ./${PROJECT}/docker-compose.yml exec web env TRAVIS=${TRAVIS} TRAVIS_JOB_ID=${TRAVIS_JOB_ID} TRAVIS_BRANCH=${TRAVIS_BRANCH} TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST} coveralls ;
fi ;