forked from geoalchemy/geoalchemy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
84 lines (73 loc) · 3.14 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
language: python
sudo: required
python:
- "2.7"
- "3.4"
services:
- postgres
# - mysql
addons:
mariadb: '10.1'
apt:
packages:
- cmake
- unixodbc
- unixodbc-dev
- odbcinst1debian2
- odbcinst
- freetds-dev
- freetds-bin
- tdsodbc
- libc6
- e2fsprogs
- mysql-client
- libproj-dev
- libgeos-dev
- libspatialite-dev
env:
- DB=generic
- DB=postgres POSTGIS_VERSION=1.5
- DB=postgres POSTGIS_VERSION=2
- DB=mysql
install:
- echo "[mysqld]" > $HOME/.my.cnf
- echo "default-storage-engine = MYISAM" >> $HOME/.my.cnf
- sudo sudo service mysql restart
# install GeoAlchemy in editable mode
- pip install -e .
# install nose and rednose for colorful output
- pip install nose rednose
# install individual dependencies
- if [[ "$DB" == "postgres" ]]; then pip install psycopg2; fi
- if [[ "$DB" == "mysql" ]]; then pip install MySQL-python; fi
# install PostGIS 2.x
- if [[ "$DB" == "postgres" ]] && [[ "$POSTGIS_VERSION" != "1.5" ]]; then sudo apt-add-repository -y ppa:sharpie/for-science; fi
- if [[ "$DB" == "postgres" ]] && [[ "$POSTGIS_VERSION" != "1.5" ]]; then sudo apt-add-repository -y ppa:sharpie/postgis-nightly; fi
- if [[ "$DB" == "postgres" ]] && [[ "$POSTGIS_VERSION" != "1.5" ]]; then sudo apt-get update; fi
- if [[ "$DB" == "postgres" ]] && [[ "$POSTGIS_VERSION" != "1.5" ]]; then sudo apt-get update; fi
# Install PostGIS 1.5
- if [[ "$POSTGIS_VERSION" == "1.5" ]]; then sudo apt-get install -y --force-yes postgresql-9.1-postgis=1.5.3-2 postgis=1.5.3-2; fi
before_script:
# activate verbose and rednose mode
- export NOSE_REDNOSE=1
- export NOSE_VERBOSE=2
# create database user "gis"
- if [[ "$DB" == "postgres" ]]; then psql -U postgres -c "CREATE ROLE gis PASSWORD 'gis' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;"; fi
- if [[ "$DB" == "mysql" ]]; then mysql --user=root -e "CREATE USER 'gis'@'localhost' IDENTIFIED BY 'gis';"; fi
- if [[ "$DB" == "mysql" ]]; then mysql --user=root -e "GRANT ALL ON *.* TO 'gis'@'localhost';"; fi
# create database "gis"
- if [[ "$DB" == "postgres" ]]; then psql -U postgres -c "CREATE DATABASE gis;"; fi
- if [[ "$DB" == "mysql" ]]; then mysql --user=root -e "CREATE DATABASE gis;"; fi
# add PostGIS extension to "gis" database
- if [[ "$DB" == "postgres" ]] && [[ "$POSTGIS_VERSION" == "1.5" ]]; then psql -d gis -U postgres -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql; fi
- if [[ "$DB" == "postgres" ]] && [[ "$POSTGIS_VERSION" == "1.5" ]]; then psql -d gis -U postgres -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql; fi
- if [[ "$DB" == "postgres" ]] && [[ "$POSTGIS_VERSION" != "1.5" ]]; then psql -d gis -U postgres -c "CREATE EXTENSION postgis;"; fi
script:
# run tests
- if [[ "$DB" == "generic" ]]; then python geoalchemy/tests/test_dialect.py; fi
- if [[ "$DB" == "generic" ]]; then python geoalchemy/tests/test_type.py; fi
- if [[ "$DB" == "postgres" ]]; then python geoalchemy/tests/test_postgis.py; fi
- if [[ "$DB" == "mysql" ]]; then python geoalchemy/tests/test_mysql.py; fi
notifications:
email:
on_failure: change