/
.travis.yml
52 lines (43 loc) · 2.01 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
language: python
sudo: false
cache:
apt: true
directories:
- $HOME/.pip-cache/
python:
- "2.7"
virtualenv:
system_site_packages: true
env:
global:
- LINT_CHECK=0 ODOO_LINT=0 TESTS="0" VERSION="8.0" ODOO_REPO="vauxoo/odoo"
matrix:
- LINT_CHECK=1
- ODOO_LINT=1
- TESTS="1" UNIT_TEST="1"
addons:
apt:
packages:
- expect-dev # provides unbuffer utility
- python-lxml # because pip installation is slow
- python-simplejson
- python-serial
- python-xlrd
install:
- git clone --single-branch --depth=1 https://github.com/vauxoo/maintainer-quality-tools.git -b master ${HOME}/maintainer-quality-tools
- find ${HOME}/maintainer-quality-tools/travis -name test_flake8 -exec sed -i "s/get_modules/get_modules_changed/g" {} \;
- find ${HOME}/maintainer-quality-tools/travis -name test_flake8 -exec sed -i "s/get_modules_changed(os.path.abspath('.')/get_modules_changed(os.path.abspath('.'), 'origin\/' \+ os.environ['TRAVIS_BRANCH']/g" {} \;
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- travis_install_nightly
script:
# get modules changed and set environment variable INCLUDE_LINT
- PYTHONPATH=${PATH} python -c "import getaddons;print 'export INCLUDE_LINT=\"' + ' '.join(getaddons.get_modules_changed('${TRAVIS_BUILD_DIR}', 'origin/${TRAVIS_BRANCH}')) + '\"'" >${TRAVIS_BUILD_DIR}/modules_changed.profile
- PYTHONPATH=${PATH} python -c "import os, getaddons;print 'export INCLUDE=\"' + ','.join(map(os.path.basename, getaddons.get_modules_changed('${TRAVIS_BUILD_DIR}', 'origin/${TRAVIS_BRANCH}'))) + '\"'" >>${TRAVIS_BUILD_DIR}/modules_changed.profile
- source ${TRAVIS_BUILD_DIR}/modules_changed.profile
# If there isn't modules changed for lint checks then exit
- if [[ "x${INCLUDE_LINT}" == "x" && "${TESTS}" == "0" ]]; then exit 0; fi
# Travis tests disabled. Travis can't download private repositories.
- if [[ "${TESTS}" == "1" && "${RUNBOT}" != "1" ]]; then exit 0; fi
- travis_wait travis_run_tests
after_success:
- travis_after_tests_success