Reorganize travis scripts for clarity
[plcapi.git] / .travis.yml
1 language: php
2
3 php:
4   - 5.3
5   - 5.4
6   - 5.5
7   - 5.6
8   - 7.0
9   - hhvm
10
11 before_install:
12   # This is mandatory or the 'apt-get install' calls following will fail
13   - sudo apt-get update -qq
14   - sudo apt-get install -y apache2 libapache2-mod-fastcgi
15   - sudo apt-get install -y privoxy
16
17 install:
18   - composer self-update && composer install
19
20 before_script:
21   # Disable xdebug. NB: this should NOT be done for hhvm...
22   - if [ "$TRAVIS_PHP_VERSION" != "hhvm" -a "$TRAVIS_PHP_VERSION" != "7.0" ]; then phpenv config-rm xdebug.ini; fi
23
24   # Set up Apache and Privoxy instances inside the Travis VM and use them for testing against
25   - if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then ./tests/ci/travis/setup_php_fpm.sh; ./tests/ci/travis/setup_apache.sh; fi
26   - if [ "$TRAVIS_PHP_VERSION" = "hhvm" ]; then ./tests/ci/travis/setup_hhvm.sh; ./tests/ci/travis/setup_apache_hhvm.sh; fi
27   - ./tests/ci/travis/setup_privoxy.sh
28
29 script:
30   # to have code coverage: --coverage-clover=coverage.clover
31   # Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
32   # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below
33   phpunit tests LOCALSERVER=localhost URI=/demo/server/server.php HTTPSSERVER=localhost HTTPSURI=/demo/server/server.php PROXY=localhost:8080 HTTPSVERIFYHOST=0 HTTPSIGNOREPEER=1 SSLVERSION=3
34
35 after_failure:
36   # Save as much info as we can to help developers
37   - cat apache_error.log
38   - cat apache_access.log
39   - php -i
40
41 after_script:
42 #  # Upload code-coverage to Scrutinizer
43 #  - wget https://scrutinizer-ci.com/ocular.phar
44 #  - php ocular.phar code-coverage:upload --format=php-clover coverage.clover