1
0
mirror of https://github.com/danog/ext-pq.git synced 2025-01-22 22:01:33 +01:00

Improve Travis setup

This commit is contained in:
Chris Wright 2014-12-16 15:35:46 +00:00
parent 4822c94ec2
commit e7ce3fd45d
7 changed files with 60 additions and 36 deletions

View File

@ -3,15 +3,31 @@ language: c
addons:
postgresql: "9.3"
env:
global:
- BUILD_SRC_DIR=/src
- BUILD_INSTALL_DIR=/install
- PHP_EXTENSIONS="--enable-json --with-mhash"
- PG_TEST_DB_NAME=pq_test
- PG_TEST_DB_USER=postgres
- REPORT_EXIT_STATUS=1
matrix:
- PHP_TARGET_REF=PHP-5.4 PHP_CONFIGURE_OPTS=""
- PHP_TARGET_REF=PHP-5.4 PHP_CONFIGURE_OPTS="--enable-maintainer-zts"
- PHP_TARGET_REF=PHP-5.5 PHP_CONFIGURE_OPTS=""
- PHP_TARGET_REF=PHP-5.5 PHP_CONFIGURE_OPTS="--enable-maintainer-zts"
- PHP_TARGET_REF=PHP-5.6 PHP_CONFIGURE_OPTS=""
- PHP_TARGET_REF=PHP-5.6 PHP_CONFIGURE_OPTS="--enable-maintainer-zts"
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
- ./travis/compile-php.sh
- ./travis/compile-ext-raphf.sh
- ./travis/compile-ext-pq.sh
- ./travis/configure-postgres.sh
script:
- REPORT_EXIT_STATUS=1 $HOME/bin/php ./run-tests.php -p $HOME/bin/php --show-diff
- $HOME$BUILD_INSTALL_DIR/bin/php ./run-tests.php -q -p $HOME$BUILD_INSTALL_DIR/bin/php --show-diff

10
travis/compile-ext-pq.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh -x
set -e
$HOME$BUILD_INSTALL_DIR/bin/phpize
./configure --with-php-config=$HOME$BUILD_INSTALL_DIR/bin/php-config --with-pq
make -j2 --quiet install
echo 'extension=pq.so' > $HOME$BUILD_INSTALL_DIR/conf.d/20-pq.ini

13
travis/compile-ext-raphf.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh -x
set -e
git clone --depth 1 https://github.com/php/pecl-php-raphf $HOME$BUILD_SRC_DIR/raphf
cd $HOME$BUILD_SRC_DIR/raphf
$HOME$BUILD_INSTALL_DIR/bin/phpize
./configure --with-php-config=$HOME$BUILD_INSTALL_DIR/bin/php-config --enable-raphf
make -j2 --quiet install
echo 'extension=raphf.so' > $HOME$BUILD_INSTALL_DIR/conf.d/10-raphf.ini

View File

@ -1,10 +0,0 @@
#!/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

View File

@ -1,14 +1,19 @@
#!/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
mkdir -p $HOME$BUILD_SRC_DIR
mkdir -p $HOME$BUILD_INSTALL_DIR/conf.d
cd $HOME/php/src
git clone --depth=1 --branch=$PHP_TARGET_REF https://github.com/php/php-src $HOME$BUILD_SRC_DIR/php-src
cd $HOME$BUILD_SRC_DIR/php-src
./buildconf --force
./configure --prefix=$HOME --with-config-file-scan-dir=$HOME/php.d --disable-all --enable-maintainer-zts --enable-json --with-mhash
./configure --quiet \
--prefix=$HOME$BUILD_INSTALL_DIR \
--with-config-file-scan-dir=$HOME$BUILD_INSTALL_DIR/conf.d \
--disable-all \
$PHP_CONFIGURE_OPTS \
$PHP_EXTENSIONS
make -j2 --quiet install

View File

@ -1,13 +0,0 @@
#!/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

View File

@ -1,4 +1,7 @@
#!/bin/sh -x
psql -c 'create database pq_test;' -U postgres
echo '<?php const PQ_DSN = "postgres://postgres@localhost/pq_test";' > ./tests/_setup.inc
PQ_CREATE_DB_SQL="CREATE DATABASE $PG_TEST_DB_NAME;"
PQ_DSN="postgres://$PG_TEST_DB_USER@localhost/$PG_TEST_DB_NAME"
psql -c "$PQ_CREATE_DB_SQL" -U $PG_TEST_DB_USER
echo "<?php const PQ_DSN = '$PQ_DSN';" > ./tests/_setup.inc