forked from dissemin/dissemin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
83 lines (71 loc) · 2.65 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
os: linux
dist: bionic
language: python
python:
- 3.7
- 3.8
cache:
pip
addons:
postgresql: "9.4"
apt:
packages:
- curl
- gdal-bin
- ghostscript
- libffi-dev
- libssl-dev
- openjdk-8-jre
snaps:
- pdftk
services:
- postgresql
- redis
- docker
env:
global:
# RoMEO API key
- secure: "hQg8tso/Qv4zXhP4A2ahKKhFZQSariIvUr+xqzzoTVtuN/9OuzBFjZ1UF8atM5KKGZ47fFMK2wTjbVOWjSyLH/SF3Wy8bX9oHHg1P8bXcsle6O/tfa3U/2s0UiYtThEdxp+iyQIr6cjBA0gmB0v/vFrQot91GvjlUbi70Xjfcts="
# Zenodo Sandbox API key
- secure: "KjRrTKrNyhv1xVl2UBtJ/qH0uFGItvxw7/pGFfPrcwxD5YAB5daePDaIGe/tlVy+lrQi0D9x1CA8MB2vm+Lf4jrfO+3ZHCkmb4ecbumPV7DxEbgFsralBx65PRRVUiDW1Oy0RyigxXNNdtNLvTVr1PYrZYD407HZnP6LrJP0ONM="
before_install:
# Install elasticsearch 2.4.6 which is no longer included in travis bionic repo
- sudo update-java-alternatives --set java-1.8.0-openjdk-amd64
- wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.4.6/elasticsearch-2.4.6.deb
- sudo dpkg -i --force-confnew elasticsearch-2.4.6.deb
- sudo systemctl restart elasticsearch
# Make imagemagick read pdf
- sudo sed -i 's/<policy domain="coder" rights="none" pattern="PDF" \/>/<policy domain="coder" rights="read" pattern="PDF" \/>/' /etc/ImageMagick-6/policy.xml
# Run VNU server for faster html validation
- docker run -d -it --rm -p 8888:8888 validator/validator:latest
# Rest
- export DJANGO_SETTINGS_MODULE=dissemin.settings
- export PYTHONPATH=$HOME/builds/dissemin/dissemin
- export PIP_USE_MIRRORS=true
- echo "from .travis import *" > dissemin/settings/__init__.py
- cp dissemin/settings/secret_template.py dissemin/settings/secret.py
install:
- pip install pip --upgrade
- pip install psycopg2 --quiet
- pip install -r requirements.txt --upgrade
- pip install -r requirements-dev.txt --upgrade
- pip install coveralls
- ./pyflakes.sh
- pip freeze
before_script:
- psql --version
- psql -c "CREATE DATABASE dissemin;" -U postgres
- if [ $TRAVIS_EVENT_TYPE == 'cron' ];
then
echo ">= Using all languages in tests because this is trigggered by cron <=";
export DISSEMIN_TEST_ALL_LANGUAGES="YES";
else
echo "=> Using only english language in tests because this is not triggered by cron <=";
fi
script:
- python manage.py compilemessages --exclude qqq
- coverage run --source=backend,deposit,dissemin,papers,statistics,upload,website --omit="*/migrations/*,dissemin/settings/*" -m py.test
- python manage.py compilescss
- sphinx-build -q -W -b html -d _build/doctrees doc/sphinx doc/sphinx/_build/html
after_success:
- coveralls