forked from pear/HTTP_Request2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
59 lines (53 loc) · 2.1 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
language: php
dist: trusty
matrix:
include:
- php: "5.6"
- php: "7.0"
- php: "7.1"
- php: "7.2"
- php: "7.3"
- php: "7.4"
install:
- pear channel-update pear.php.net
- composer install --no-dev
# Export Composer's global bin dir to PATH (borrowed from Wordpress):
- composer config --list --global
- export PATH=`composer config --list --global | grep '\[home\]' | { read a; echo "${a#* }/vendor/bin:$PATH"; }`
# Global install of a supported PHPUnit version
- composer global require "phpunit/phpunit=^3.7|^4.8|^5.7"
addons:
hosts:
- hr2.local
- www.hr2.local
before_script:
# directory for apache logs
- mkdir -p $TRAVIS_BUILD_DIR/logs
# As described @ http://docs.travis-ci.com/user/languages/php/#Apache-%2B-PHP
- sudo apt-get update
- sudo apt-get install apache2 libapache2-mod-php5
#- sudo apt-get install apache2 libapache2-mod-fastcgi
# enable php-fpm
#- sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
#- sudo a2enmod rewrite actions fastcgi alias
#- echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
#- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# configure apache virtual hosts
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo cp -f tests/travis-ci-apache-24 /etc/apache2/sites-available/000-default.conf
- sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/000-default.conf
- sudo service apache2 restart
# use travis config for network-backed tests
- cp tests/NetworkConfig.php.travis tests/NetworkConfig.php
script:
- which phpunit
- phpunit --version
- phpunit ./tests/
- pear package-validate ./package.xml
- php ./pear-package-helper.php
- pear install ./.pear-package/package.xml
- cp tests/NetworkConfig.php.travis `pear config-get test_dir`/HTTP_Request2/NetworkConfig.php
- cd `pear config-get test_dir` && phpunit HTTP_Request2
after_failure:
- cat $TRAVIS_BUILD_DIR/logs/hr2-error.log
- cat $TRAVIS_BUILD_DIR/logs/hr2-access.log