forked from WeblateOrg/weblate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
60 lines (60 loc) · 3.06 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
language: python
python:
- "2.7"
# - Test against all supported Django versions with sqlite
# - Test against all supported databases with current Django
# - Run Selenium tests on current Django
# - Run pylint/pep8 checker
env:
matrix:
- DJANGO_PIP="Django>=1.6,<1.7" DO_LINT=1
- DJANGO_PIP="Django>=1.7,<1.8" TRAVIS_DATABASE=mysql
- DJANGO_PIP="Django>=1.7,<1.8" TRAVIS_DATABASE=postgresql
- DJANGO_PIP="Django>=1.7,<1.8"
- DJANGO_PIP="Django>=1.6,<1.7"
- DJANGO_PIP="Django>=1.7,<1.8" TRAVIS_DATABASE=mysql TRAVIS_RUN_TESTS="-p test_selenium.py" DO_SELENIUM=1
before_install:
- git clone --depth 1 --branch v0.1.2 https://github.com/ruleant/buildtime-trend.git $HOME/buildtime-trend
- source $HOME/buildtime-trend/init.sh
- timestamp.sh packages
- sudo apt-get update -qq
- sudo apt-get install git libffi-dev libpq-dev libmysqlclient-dev libicu-dev
# commands to install dependencies
install:
- timestamp.sh install
- pip install --download-cache $HOME/.pip-cache $DJANGO_PIP
- pip install --download-cache $HOME/.pip-cache -r requirements.txt
- pip install --download-cache $HOME/.pip-cache -r requirements-optional.txt
- pip install --download-cache $HOME/.pip-cache -r travis/requirements.txt
- pip install --download-cache $HOME/.pip-cache -r travis/requirements-${TRAVIS_DATABASE:-sqlite}.txt
- pip install --download-cache $HOME/.pip-cache -r ${BUILD_TREND_HOME}/requirements.txt
# create databases
before_script:
- timestamp.sh before_script
- mysql -e 'create database weblate;'
- psql -c 'create database weblate;' -U postgres
- if [ -n "$DO_SELENIUM" ] ; then curl -L https://gist.githubusercontent.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash ; fi
- echo -e "[server]\nmax_allowed_packet=64M\nwait_timeout=28800" | sudo tee -a /etc/mysql/conf.d/weblate.cnf
- sudo service mysql restart
# commands to run tests
script:
- timestamp.sh tests
- if [ -n "$DO_LINT" ] ; then ./scripts/generate-locales ; fi
- if [ -z "$DO_LINT" ] ; then ./manage.py validate --settings weblate.settings_test ; fi
- if [ "$TRAVIS_DATABASE" = sqlite -a -z "$DO_LINT" ] ; then ./travis/migrate-testing ; fi
- if [ -z "$DO_LINT" ] ; then ./manage.py syncdb --noinput --settings weblate.settings_test ; fi
- if [ -z "$DO_LINT" ] ; then ./manage.py migrate --settings weblate.settings_test --traceback ; fi
- if [ -z "$DO_LINT" ] ; then coverage run --source=. ./manage.py test --settings weblate.settings_test $TRAVIS_RUN_TESTS ; fi
- if [ -n "$DO_LINT" ] ; then pep8 --exclude south_migrations,migrations weblate ; fi
- if [ -n "$DO_LINT" ] ; then pylint --rcfile=pylint.rc weblate ; fi
- if [ -n "$DO_LINT" ] ; then pyflakes `find . -name '*.py' -not -name '__init__.py' -not -name 'settings_test_nose.py' -not -name 'settings_test.py'` ; fi
after_script:
- timestamp.sh coveralls
- if [ -z "$DO_LINT" ] ; then coveralls ; fi
- if [ -z "$DO_LINT" ] ; then ocular --data-file ".coverage" --config-file ".coveragerc" ; fi
- timestamp.sh done
- sync-buildtime-trend-with-gh-pages.sh
cache:
apt: true
directories:
- $HOME/.pip-cache/