Add travis config
authorChris Wright <daverandom@php.net>
Sun, 14 Dec 2014 14:37:43 +0000 (14:37 +0000)
committerChris Wright <daverandom@php.net>
Mon, 15 Dec 2014 12:35:31 +0000 (12:35 +0000)
.travis.yml [new file with mode: 0644]
travis/compile-ext.sh [new file with mode: 0755]
travis/compile-php.sh [new file with mode: 0755]
travis/compile-raphf.sh [new file with mode: 0755]
travis/configure-postgres.sh [new file with mode: 0755]

diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..296407f
--- /dev/null
@@ -0,0 +1,17 @@
+language: c
+
+addons:
+    postgresql: "9.3"
+
+before_install:
+    - sudo apt-get update -qq
+    - sudo apt-get install -qq libpq-dev
+
+before_script:
+    - sudo ./travis/compile-php.sh
+    - sudo ./travis/compile-raphf.sh
+    - sudo ./travis/compile-ext.sh
+    - sudo ./travis/configure-postgres.sh
+
+script:
+    - REPORT_EXIT_STATUS=1 $HOME/bin/php ./run-tests.php -p $HOME/bin/php --show-diff
diff --git a/travis/compile-ext.sh b/travis/compile-ext.sh
new file mode 100755 (executable)
index 0000000..17b6be8
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh -x
+
+set -e
+
+$HOME/bin/phpize
+./configure --with-php-config=$HOME/bin/php-config --with-pq
+
+make -j2 --quiet install
+
+echo 'extension=pq.so' > $HOME/php.d/20-pq.ini
diff --git a/travis/compile-php.sh b/travis/compile-php.sh
new file mode 100755 (executable)
index 0000000..63c8142
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh -x
+
+set -e
+TARGET_PHP_REF="PHP-5.6"
+
+mkdir -p $HOME/php
+mkdir -p $HOME/php.d
+git clone --depth=1 --branch=$TARGET_PHP_REF https://github.com/php/php-src $HOME/php/src
+
+cd $HOME/php/src
+./buildconf --force
+./configure --prefix=$HOME --with-config-file-scan-dir=$HOME/php.d --disable-all --enable-maintainer-zts --enable-json --with-mhash
+
+make -j2 --quiet install
diff --git a/travis/compile-raphf.sh b/travis/compile-raphf.sh
new file mode 100755 (executable)
index 0000000..99aa4b0
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh -x
+
+set -e
+
+git clone --depth 1 https://github.com/php/pecl-php-raphf $HOME/raphf
+cd $HOME/raphf
+
+$HOME/bin/phpize
+./configure --with-php-config=$HOME/bin/php-config --with-pq
+
+make -j2 --quiet install
+
+echo 'extension=raphf.so' > $HOME/php.d/10-raphf.ini
diff --git a/travis/configure-postgres.sh b/travis/configure-postgres.sh
new file mode 100755 (executable)
index 0000000..de5355c
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh -x
+
+psql -c 'create database pq_test;' -U postgres
+echo '<?php const PQ_DSN = "postgres://postgres@localhost/pq_test";' > ./tests/_setup.inc