forked from perseas/Pyrseas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
50 lines (45 loc) · 2.01 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
language: python
addons:
apt:
update: true
packages: postgresql-common
sources:
- sourceline: deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main
jobs:
include:
- python: "2.7"
env: POSTGRES=9.4
- python: "2.7"
env: POSTGRES=9.5
- python: "2.7"
env: POSTGRES=9.6
- python: "3.6"
env: POSTGRES=10
- python: "3.7"
env: POSTGRES=11
- python: "3.8"
env: POSTGRES=12
# Ensure the desired version of Postgres is installed and running
# Most of this is normally handled by Travis automatically, but only for certain versions of Postgres
# https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/bash/travis_setup_postgresql.bash
before_install:
- sudo systemctl stop postgresql
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends $(travis_apt_get_options) install postgresql-$POSTGRES postgresql-plperl-$POSTGRES postgresql-plpython3-$POSTGRES
# the port may have been auto-configured to use 5433 if it thought 5422 was already in use
- sudo sed -i -e 's/5433/5432/' /etc/postgresql/*/main/postgresql.conf
# postgresql-11+ default to "peer"
- sudo sed -i -E -e 's/^local\s+all\s+postgres\s+peer/local all postgres trust/' /etc/postgresql/*/main/pg_hba.conf
- sudo mkdir -p /var/ramfs/postgresql
- if [ ! -d /var/ramfs/postgresql/$POSTGRES ]; then sudo cp -rp /var/lib/postgresql/$POSTGRES /var/ramfs/postgresql/$POSTGRES; fi
- sudo systemctl start postgresql@$POSTGRES-main
- (cd /; sudo -u postgres createuser -e -s travis || echo failed createuser)
- (cd /; sudo -u postgres createdb -e -O travis travis || echo failed created)
# Ensure Postgres is configured as described in docs/testing.rst
before_script:
- sudo locale-gen --no-archive fr_FR.UTF-8
- sudo mkdir -p /extra/pg/ts1 /extra/pg/ts2
- sudo chown postgres:postgres /extra/pg/ts1 /extra/pg/ts2
- psql -Upostgres -c "CREATE TABLESPACE ts1 LOCATION '/extra/pg/ts1'"
- psql -Upostgres -c "CREATE TABLESPACE ts2 LOCATION '/extra/pg/ts2'"
script:
- python setup.py test