Merge pull request #71 from zborboa-google/master

Fix #45: Replace HHVM's built-in webserver with Nginx for continuous integration tests
This commit is contained in:
Zach Borboa
2014-07-24 10:58:22 -07:00
4 changed files with 29 additions and 13 deletions
+6 -6
View File
@@ -1,19 +1,19 @@
language: php
php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
matrix:
allow_failures:
- php: 5.6
- php: hhvm
before_script:
- if [[ "$TRAVIS_PHP_VERSION" == "5.4" ]]; then sh -c "php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &"; fi
- if [[ "$TRAVIS_PHP_VERSION" == "5.5" ]]; then sh -c "php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &"; fi
- if [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then sh -c "php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &"; fi
- if [[ "$TRAVIS_PHP_VERSION" == "hhvm" ]]; then sh -c "cd tests && hhvm --mode server --port 8000 --config PHPCurlClass/server.hdf &"; fi
- bash tests/before_script.sh
script:
- find . -type "f" -iname "*.php" | xargs -L "1" php -l
- if [[ "$TRAVIS_PHP_VERSION" != "5.3" ]]; then sh -c "cd tests && phpunit --configuration phpunit.xml"; fi
- bash tests/script.sh
-7
View File
@@ -1,7 +0,0 @@
Log {
Level = Verbose
}
Server {
DefaultDocument = index.php
}
+18
View File
@@ -0,0 +1,18 @@
if [[ "${TRAVIS_PHP_VERSION}" == "5.4" ]]; then
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
elif [[ "${TRAVIS_PHP_VERSION}" == "5.5" ]]; then
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
elif [[ "${TRAVIS_PHP_VERSION}" == "5.6" ]]; then
php -S 127.0.0.1:8000 -t tests/PHPCurlClass/ &
elif [[ "${TRAVIS_PHP_VERSION}" == "hhvm" ]]; then
sudo add-apt-repository -y ppa:nginx/stable
sudo apt-get update
sudo apt-get install -y nginx
sudo /usr/share/hhvm/install_fastcgi.sh
root="$(pwd)/tests/PHPCurlClass"
root="${root//\//\\/}"
sudo sed --in-place --regexp-extended 's/listen 80 default_server;/listen 8000 default_server;/' /etc/nginx/sites-enabled/default
sudo sed --in-place --regexp-extended "s/root \/usr\/share\/nginx\/html;/root ${root};/" /etc/nginx/sites-enabled/default
sudo sed --in-place --regexp-extended 's/index index.html index.htm;/index index.php;/' /etc/nginx/sites-enabled/default
sudo /etc/init.d/nginx restart
fi
+5
View File
@@ -0,0 +1,5 @@
find . -type "f" -iname "*.php" | xargs -L "1" php -l
if [[ "${TRAVIS_PHP_VERSION}" != "5.3" ]]; then
cd tests && phpunit --configuration phpunit.xml
fi