forked from WeblateOrg/weblate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
87 lines (87 loc) · 3.08 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
#
# Weblate testsuite for Travis-CI
#
# - Test against all supported Django versions with postgresql
# - Test against all supported databases with current Django
# - Run Selenium tests on current Django
# - Test setup.py
#
dist: trusty
language: python
python:
- "2.7"
# build matrix configuration
env:
matrix:
- CI_DEPS="Django>=1.11,<1.12" CI_DATABASE=sqlite
- CI_DEPS="Django>=1.11,<1.12" CI_DATABASE=mysql
- CI_DEPS="Django>=1.11,<1.12" CI_DATABASE=postgresql
- CI_DEPS="Django>=1.11,<1.12" CI_DATABASE=postgresql CI_MODE=selenium
- CI_DEPS="Django>=1.11,<1.12" CI_DATABASE=postgresql CI_MODE=setup
global:
- DJANGO_SETTINGS_MODULE=weblate.settings_test
- CI_MODE=test
- SAUCE_USERNAME=nijel
# commands to install dependencies
install:
- export TESSERACT_INSTALL=`pwd`/.tesseract
- export TESSERACT_PKG=$TESSERACT_INSTALL/lib/pkgconfig
- export LD_LIBRARY_PATH=$TESSERACT_INSTALL/lib:$LD_LIBRARY_PATH
- export PKG_CONFIG_PATH=$TESSERACT_PKG:$PKG_CONFIG_PATH
- export TESSDATA_PREFIX=/usr/share/tesseract-ocr/tessdata/
- wget --no-check-certificate -O - https://dl.cihar.com/ci/tesseract.tar.xz | tar xJ
- if [ ! -f $TESSERACT_PKG/tesseract.pc -o ! -f $TESSERACT_PKG/lept.pc ] ; then ./ci/install-tesseract ; fi
# Get newer pip and whell for binary caching support
- pip install --upgrade pip wheel
# Install PyPI packages
- pip install $CI_DEPS Cython
- pip install -r requirements-optional.txt -r ci/requirements-travis.txt
- if [ -n "$CI_DATABASE" -a -f ci/requirements-${CI_DATABASE}.txt ] ; then pip install -r ci/requirements-${CI_DATABASE}.txt ; fi
- if [ "$CI_MODE" = selenium -a -n "$SAUCE_USERNAME" -a -n "$SAUCE_ACCESS_KEY" ] ; then ./ci/install-sauce ; fi
# create databases
before_script:
- mysql -e 'SET GLOBAL character_set_server=utf8' -uroot
- mysql -e 'SET GLOBAL collation_server=utf8_general_ci' -uroot
- mysql -e 'DROP DATABASE IF EXISTS weblate;' -uroot
- mysql -e 'CREATE DATABASE weblate CHARACTER SET utf8 COLLATE utf8_general_ci;' -uroot
- psql -c 'DROP DATABASE IF EXISTS weblate;' -U postgres
- psql -c 'CREATE DATABASE weblate;' -U postgres
- ./manage.py list_versions
# commands to run tests
script:
- ./ci/run-$CI_MODE
# upload coverage
after_script:
# Kill Sauce Connect Proxy if running
- if [ -f ~/.sauce-pid ] ; then kill `cat ~/.sauce-pid` ; fi
# Combine partial reports
- coverage combine
- coverage xml
# CodeCov
- codecov
# Codacy
- python-codacy-coverage -r coverage.xml
# use docker based faster build
sudo: false
matrix:
include:
- python: "3.6"
env: CI_DEPS="Django>=1.11,<1.12" CI_DATABASE=postgresql
- python: "3.6"
env: CI_DEPS="Django>=2.0,<2.1" CI_DATABASE=postgresql
- python: "3.6"
env: CI_DEPS="sphinxcontrib-httpdomain" CI_MODE=docs
addons:
apt:
packages:
- git-svn
- graphviz
- tesseract-ocr
- g++
jwt:
secure: AuFIS22evw30Mummenq+F2l5sHVI4UxmXjBWws0jWpBmz1Yc/quP4Bxf751S0QSFqQioG8fWlSCWp9KMJ7gPONhPQiDx51BXAxdtAXudw/wP1goWLOt1MVHkN/L+GHmI0Tuoz8E1Dv11YZKvqY2w5l7cw9vXQq6423d6zc5sKIY=
services:
- postgresql
- mysql
cache:
pip: true