-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy path.travis.yml
More file actions
47 lines (43 loc) · 1.48 KB
/
.travis.yml
File metadata and controls
47 lines (43 loc) · 1.48 KB
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
# https://medium.com/@MicroPyramid/set-up-travis-ci-for-django-project-427d6dd2f46c
# https://github.com/ndarville/pony-forum/blob/master/.travis.yml
dist: xenial # required for Python >= 3.7
language: python
python:
- "3.7"
env:
global:
- DJANGO_SETTINGS_MODULE="representable.settings"
- PYTHONPATH="/home/travis/build/representable/representable"
- PIP_USE_MIRRORS=true
- SECRET_KEY="testkey-travisci"
# Install the version of PostGIS that matches your PostgreSQL version,
# and activate the PostGIS extension using:
services:
- postgresql
addons:
apt:
packages:
- postgresql-11
- postgresql-11-postgis-2.5
- postgresql-11-postgis-2.5-scripts
# https://github.com/hisener/postgresql-travis
before_install:
- sudo sed -i 's/port = 5433/port = 5432/' /etc/postgresql/11/main/postgresql.conf
- sudo cp /etc/postgresql/{10,11}/main/pg_hba.conf
- sudo service postgresql stop
- sudo service postgresql start 11
# command to install dependencies
install:
- pip install -r requirements.txt
- pip install coverage
# Run before script.
before_script:
- psql --version
- psql -c 'create database travis_ci_test;' -U postgres
- psql -U postgres -c "create extension postgis;"
# command to run tests
script:
- python3 manage.py collectstatic --settings=representable.settings.dev
- coverage run manage.py test --settings=representable.settings.dev
after_success:
- bash <(curl -s https://codecov.io/bash)