-
Notifications
You must be signed in to change notification settings - Fork 87
/
.travis.yml
56 lines (46 loc) · 1.43 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
language: python
python: "2.7"
services:
- redis-server
- postgresql
dist: trusty
addons:
postgresql: "9.5"
apt:
packages:
- postgresql-9.5-postgis-2.3
env:
global:
DJANGO_SETTINGS_MODULE="opentreemap.settings"
before_install:
- nvm install 4.8.0
- nvm use 4.8.0
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
# Avoid `spurious errors` caused by ~/.npm permission issues
# Does it already exist? Who owns? What permissions?
# (https://github.com/travis-ci/travis-ci/issues/2244#issuecomment-55473829)
- ls -lah ~/.npm || mkdir ~/.npm
# Make sure we own it
- sudo chown -R $USER ~/.npm
install:
- pip install -r travis-requirements.txt
- npm install
before_script:
- cp ci/local_settings.py opentreemap/opentreemap/settings/local_settings.py
- psql -c "CREATE EXTENSION hstore;" -U postgres -d template1
- psql -c "CREATE DATABASE ci;" -U postgres
- psql -c "CREATE EXTENSION postgis;" -U postgres -d ci
- python opentreemap/manage.py migrate --noinput
- mkdir -p /tmp/otm/static
- mkdir -p /tmp/otm/media
- python opentreemap/manage.py collectstatic_js_reverse
- npm run build
- python opentreemap/manage.py collectstatic --noinput
script:
- flake8 --exclude migrations,opentreemap/settings/local_settings.py,*.pyc opentreemap
- npm run check
- npm run test
- cd opentreemap && coverage run --rcfile=../.coveragerc --source=. manage.py test
after_success:
coveralls