-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
42 lines (31 loc) · 1.19 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
sudo: false
services:
- mysql
- postgresql
addons:
code_climate:
repo_token: 41c19e20da39887c90e4534b37bd345eeb6b698efd2bb94fba3b64b2d1b9f497
env:
- DATABASE_URL=postgres://postgres:@localhost:5432/test_database
- DATABASE_URL=mysql://root:@localhost:3306/test_database
- DATABASE_URL=sqlite://
language: python
cache: pip
python:
- "2.7"
- "3.4"
- "3.5"
notifications:
email: false
install:
- pip install -r requirements.txt
- python setup.py install
before_script:
- sh -c "if [ '$DATABASE_URL' = "postgres://postgres:@localhost:5432/test_database" ] ; then psql -c 'DROP DATABASE IF EXISTS test_database;' -U postgres ; fi"
- sh -c "if [ '$DATABASE_URL' = "postgres://postgres:@localhost:5432/test_database" ] ; then psql -c 'CREATE DATABASE test_database;' -U postgres ; fi"
- sh -c "if [ '$DATABASE_URL' = "mysql://root:@localhost:3306/test_database" ] ; then mysql -e 'CREATE DATABASE IF NOT EXISTS test_database;' ; fi"
- sh -c "echo $DATABASE_URL"
script:
- sh -c "if [ '${TRAVIS_PULL_REQUEST}' = "false" && '$TRAVIS_BRANCH' != "master" ] ; then nosetests ./tests/unit --with-coverage ; else nosetests --with-coverage; fi"
after_success:
- coveralls