|
1 | | -language: "python" |
2 | | - |
3 | 1 | sudo: required |
4 | 2 |
|
5 | 3 | services: |
6 | | - - postgresql |
7 | | - |
8 | | -env: |
9 | | - - PG_VER=9.5 |
10 | | - - PG_VER=9.6 |
11 | | - - PG_VER=10 |
12 | | - |
13 | | -python: |
14 | | - - "2.7" |
15 | | - - "3.5" |
16 | | - - "3.6" |
17 | | - - "pypy" |
18 | | - - "pypy3" |
19 | | - |
20 | | -before_install: |
21 | | - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -y install -qq wget ca-certificates; fi |
22 | | - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo sh ./travis/dep-ubuntu-postgres.sh; fi |
23 | | - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -qq; fi |
24 | | - |
25 | | -install: |
26 | | - - sudo service postgresql stop |
27 | | - - echo 'exit 0' | sudo tee /etc/init.d/postgresql |
28 | | - - sudo chmod a+x /etc/init.d/postgresql |
| 4 | + - docker |
29 | 5 |
|
30 | 6 | before_script: |
31 | | - - sudo pg_createcluster --start $PG_VER testgres -- -A trust |
32 | | - - sudo chmod a+w /var/run/postgresql/ |
33 | | - - sudo /etc/init.d/postgresql restart |
34 | | - - export PG_CONFIG=/usr/lib/postgresql/$PG_VER/bin/pg_config |
35 | | - - virtualenv /tmp/envs/testgres |
36 | | - - source /tmp/envs/testgres/bin/activate |
37 | | - - pip install six psycopg2 pg8000 flake8 |
38 | | - - python setup.py install |
| 7 | + - sed -e 's/${PYTHON_VERSION}/'${PYTHON_VERSION}/g -e 's/${PG_VERSION}/'${PG_VERSION}/g Dockerfile.tmpl > Dockerfile |
| 8 | + - docker-compose build |
39 | 9 |
|
40 | 10 | script: |
41 | | - - cd testgres/tests |
42 | | - - python -m unittest test_simple |
43 | | - - flake8 --ignore=W191,F401,E501,F403 . |
| 11 | + - docker-compose run tests |
44 | 12 |
|
45 | 13 | notifications: |
46 | | - email: |
47 | | - on_success: change |
48 | | - on_failure: always |
| 14 | + email: |
| 15 | + on_success: change |
| 16 | + on_failure: always |
| 17 | + |
| 18 | +matrix: |
| 19 | + - PYTHON_VERSION=2 PG_VERSION=10 |
| 20 | + - PYTHON_VERSION=2 PG_VERSION=9.6 |
| 21 | + - PYTHON_VERSION=2 PG_VERSION=9.5 |
| 22 | + - PYTHON_VERSION=3 PG_VERSION=10 |
| 23 | + - PYTHON_VERSION=3 PG_VERSION=9.6 |
| 24 | + - PYTHON_VERSION=3 PG_VERSION=9.5 |
0 commit comments