Added travis configuration for CI tests

This commit is contained in:
Daniele Varrazzo 2017-03-25 22:52:40 +00:00
parent d0217d81e3
commit 2a9ca79772
4 changed files with 67 additions and 0 deletions

22
.travis.yml Normal file
View File

@ -0,0 +1,22 @@
# Travis CI configuration file for psycopg2
dist: trusty
sudo: required
env:
- PGVER=9.6
- PGVER=9.5
- PGVER=9.4
- PGVER=9.3
- PGVER=9.2
install:
- source regress/travis_prepare.sh
- make
- sudo make install
script:
- regress/travis_test.sh
notifications:
email: false

View File

@ -7,6 +7,12 @@ pg_repack -- Reorganize tables in PostgreSQL databases with minimal locks
- Bug Report: https://github.com/reorg/pg_repack/issues
- Mailing List: http://pgfoundry.org/mailman/listinfo/reorg-general
|travis|
.. |travis| image:: https://travis-ci.org/reorg/pg_repack.svg?branch=master
:target: https://travis-ci.org/reorg/pg_repack
:alt: Linux and OSX build status
pg_repack_ is a PostgreSQL extension which lets you remove bloat from
tables and indexes, and optionally restore the physical order of clustered
indexes. Unlike CLUSTER_ and `VACUUM FULL`_ it works online, without

29
regress/travis_prepare.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/bash
set -e -x
export PACKAGE="$PGVER"
export PGDIR="/usr/lib/postgresql/$PACKAGE"
export CONFDIR="/etc/postgresql/$PACKAGE/main"
export DATADIR="/var/lib/postgresql/$PACKAGE/main"
export PGBIN="$PGDIR/bin"
export PATH="$PGBIN:$PATH"
# Match libpq and server-dev packages
# See https://github.com/reorg/pg_repack/issues/63
sudo sed -i "s/main[[:space:]]*$/main ${PGVER}/" \
/etc/apt/sources.list.d/pgdg.list
sudo apt-get update
sudo apt-get remove -y libpq5
sudo apt-get install -y "libpq5=${PGVER}*" "libpq-dev=${PGVER}*"
sudo apt-mark hold libpq5
sudo apt-get install -y postgresql-server-dev-$PGVER postgresql-$PGVER
# Go somewhere else or sudo will fail
cd /
# Already started because of installing posgresql-$PGVER
# sudo -u postgres "$PGBIN/pg_ctl" -w -l /dev/null -D "$CONFDIR" start
sudo -u postgres mkdir -p /var/lib/postgresql/testts
sudo -u postgres "$PGBIN/psql" \
-c "create tablespace testts location '/var/lib/postgresql/testts'"
cd -

10
regress/travis_test.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
set -x
export PG_REGRESS_DIFF_OPTS=-u
if ! make installcheck; then
cat regress/regression.diffs
exit 1
fi