From 7f158e111eb753a090eac95e55b586d58c97d3ca Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Sun, 14 Dec 2014 14:37:43 +0000 Subject: [PATCH] Add travis config --- .travis.yml | 17 +++++++++++++++++ travis/compile-ext.sh | 10 ++++++++++ travis/compile-php.sh | 14 ++++++++++++++ travis/compile-raphf.sh | 13 +++++++++++++ travis/configure-postgres.sh | 4 ++++ 5 files changed, 58 insertions(+) create mode 100644 .travis.yml create mode 100755 travis/compile-ext.sh create mode 100755 travis/compile-php.sh create mode 100755 travis/compile-raphf.sh create mode 100755 travis/configure-postgres.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..296407f --- /dev/null +++ b/.travis.yml @@ -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 index 0000000..17b6be8 --- /dev/null +++ b/travis/compile-ext.sh @@ -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 index 0000000..63c8142 --- /dev/null +++ b/travis/compile-php.sh @@ -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 index 0000000..99aa4b0 --- /dev/null +++ b/travis/compile-raphf.sh @@ -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 index 0000000..de5355c --- /dev/null +++ b/travis/configure-postgres.sh @@ -0,0 +1,4 @@ +#!/bin/sh -x + +psql -c 'create database pq_test;' -U postgres +echo ' ./tests/_setup.inc -- 2.30.2