forked from adriansuter/Slim4-CI
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
51 lines (43 loc) · 1.84 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
language: php
sudo: false
php:
- "7.1.30"
env:
- PSR7="Slim"
- PSR7="Nyholm"
- PSR7="Guzzle"
- PSR7="Zend"
- SLIM_DEV=true PSR7="Slim"
- SLIM_DEV=true PSR7="Nyholm"
- SLIM_DEV=true PSR7="Guzzle"
- SLIM_DEV=true PSR7="Zend"
matrix:
allow_failures:
- env: SLIM_DEV=true PSR7="Slim"
- env: SLIM_DEV=true PSR7="Nyholm"
- env: SLIM_DEV=true PSR7="Guzzle"
- env: SLIM_DEV=true PSR7="Zend"
before_install:
- sudo apt-get update > /dev/null
install:
- travis_retry composer update --prefer-dist --no-interaction
- if [[ "$SLIM_DEV" ]]; then travis_retry composer require slim/slim:4.x-dev ; fi
- if [[ "$PSR7" == 'Slim' ]]; then travis_retry composer require slim/psr7 ; fi
- if [[ "$PSR7" == 'Nyholm' ]]; then travis_retry composer require nyholm/psr7 nyholm/psr7-server ; fi
- if [[ "$PSR7" == 'Guzzle' ]]; then travis_retry composer require guzzlehttp/psr7 http-interop/http-factory-guzzle ; fi
- if [[ "$PSR7" == 'Zend' ]]; then travis_retry composer require zendframework/zend-diactoros ; fi
before_script:
- 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
- sudo sed -i -e "s,www-data,travis,g" /etc/apache2/envvars
- sudo chown -R travis:travis /var/lib/apache2/fastcgi
- ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
# configure apache virtual hosts
- sudo cp -f build/travis-ci-apache.conf /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
script:
- vendor/bin/phpunit