Add travis CI integration script to run the check_postgres testsuite on travis-ci.com
authorChristoph Berg <[email protected]>
Fri, 3 Jun 2016 18:02:03 +0000 (20:02 +0200)
committerChristoph Berg <[email protected]>
Sun, 5 Jun 2016 16:42:32 +0000 (18:42 +0200)
.travis.yml [new file with mode: 0644]

diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..051d535
--- /dev/null
@@ -0,0 +1,45 @@
+# run the check_postgres testsuite on travis-ci.com
+---
+# versions to run on
+env:
+  - PGVERSION=8.4
+  - PGVERSION=9.0
+  - PGVERSION=9.1
+  - PGVERSION=9.2
+  - PGVERSION=9.3
+  - PGVERSION=9.4
+  - PGVERSION=9.5
+  - PGVERSION=9.6
+
+# we don't set "language: perl" here because that doesn't use the system perl
+
+before_install:
+  # apt.postgresql.org is already configured, we just need to add 9.6
+  - |
+    if [ "$PGVERSION" = "9.6" ]; then
+      # update pgdg-source.list
+      sudo sed -i -e 's/main/main 9.6/' /etc/apt/sources.list.d/pgdg*.list
+    fi
+  - sudo apt-get -qq update
+
+install:
+  - sudo apt-get install libdbd-pg-perl
+  # install PostgreSQL $PGVERSION if not there yet
+  - |
+    if [ ! -x /usr/lib/postgresql/$PGVERSION/bin/postgres ]; then
+      sudo apt-get install postgresql-common
+      sudo /etc/init.d/postgresql stop # travis wants only one version running
+      sudo apt-get install postgresql-contrib-$PGVERSION
+    fi
+  - sudo /etc/init.d/postgresql stop
+  - pg_lsclusters
+  - dpkg -l postgresql\* | cat
+  - printenv | sort
+
+script:
+  - rm -rf test_database_check_postgres*
+  - perl Makefile.PL
+  - PGBINDIR=/usr/lib/postgresql/$PGVERSION/bin make test
+
+after_script:
+  - tail -n 200 test_database_check_postgres*/pg.log