mirror of
https://gh.wpcy.net/https://github.com/WeblateOrg/weblate.git
synced 2026-05-28 16:43:19 +08:00
80 lines
2.6 KiB
YAML
Vendored
80 lines
2.6 KiB
YAML
Vendored
#
|
|
# Weblate testsuite for Travis-CI
|
|
#
|
|
# - Test against all supported Django versions with sqlite
|
|
# - Test against all supported databases with current Django
|
|
# - Run Selenium tests on current Django
|
|
# - Test setup.py
|
|
#
|
|
language: python
|
|
python:
|
|
- "2.7"
|
|
# build matrix configuration
|
|
env:
|
|
matrix:
|
|
- CI_PIP_DEPS="Django>=1.10,<1.11"
|
|
- CI_PIP_DEPS="Django>=1.10,<1.11" CI_MODE=setup
|
|
- CI_PIP_DEPS="Django>=1.10,<1.11" CI_DATABASE=mysql
|
|
- CI_PIP_DEPS="Django>=1.10,<1.11" CI_DATABASE=postgresql
|
|
- CI_PIP_DEPS="Django>=1.10,<1.11" CI_DATABASE=postgresql CI_MODE=selenium
|
|
- CI_PIP_DEPS="--pre Django"
|
|
- CI_PIP_DEPS="sphinxcontrib-httpdomain" CI_MODE=docs
|
|
global:
|
|
- DJANGO_SETTINGS_MODULE=weblate.settings_test
|
|
- CI_REQUIREMENTS=travis
|
|
- CI_MODE=test
|
|
- CI_DATABASE=sqlite
|
|
# 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_PIP_DEPS Cython
|
|
- pip install -r requirements-optional.txt -r ci/requirements-${CI_REQUIREMENTS}.txt -r ci/requirements-${CI_DATABASE}.txt
|
|
- if [ "$CI_MODE" = selenium -a -n "$SAUCE_USERNAME" -a -n "$SAUCE_ACCESS_KEY" ] ; then ./ci/install-sauce ; fi
|
|
# create databases
|
|
before_script:
|
|
- 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:
|
|
# 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.5"
|
|
env: CI_PIP_DEPS="Django>=1.10,<1.11"
|
|
allow_failures:
|
|
- python: "2.7"
|
|
env: CI_PIP_DEPS="--pre Django"
|
|
addons:
|
|
apt:
|
|
packages:
|
|
- git-svn
|
|
- graphviz
|
|
- tesseract-ocr
|
|
services:
|
|
- postgresql
|
|
- mysql
|
|
cache:
|
|
pip: true
|