dc0e444773916c56e46260cede0fd78129b55f9a
[plcapi.git] / .travis.yml
1 language: php
2
3 # As of May 2019, Travis is deprecating VMs based on Precise, which means that we can only test on php >= 5.6 going forward
4 # (nb: this is not necessarily true yet - and we can use a different base for each php version, but we'll have to
5 # adapt composer.json plus the apache / env setup scripts to accommodate that...)
6 dist: xenial
7
8 env:
9     global:
10         - HTTPSERVER=localhost
11         - URI=/demo/server/server.php
12         - HTTPSSERVER=localhost
13         - HTTPSURI=/demo/server/server.php
14         - PROXYSERVER=localhost:8080
15         # Travis currently compiles PHP with an oldish cURL/GnuTLS combination;
16         # to make the tests pass when Apache has a bogus SSL cert whe need the full set of options below
17         - HTTPSVERIFYHOST=0
18         - HTTPSIGNOREPEER=1
19         - SSLVERSION=0
20         - DEBUG=0
21
22 php:
23   #- 5.3
24   #- 5.4
25   #- 5.5
26   - 5.6
27   - 7.0
28   - 7.1
29   - 7.2
30   - 7.3
31   - 7.4
32   - 8.0
33
34 before_install:
35   # This is mandatory or the 'apt-get install' calls following will fail
36   - sudo apt-get update -qq
37   #- sudo apt-get install -y apache2 libapache2-mod-fastcgi
38   #- sudo apt-get install -y privoxy
39   - sudo pwd
40   - sudo ls -la
41   - sudo chmod 755 ./tests/ci/setup/*.sh
42   - sudo ./tests/ci/setup/setup_apache.sh
43   - sudo ./tests/ci/setup/setup_privoxy.sh
44   - sudo ./tests/ci/setup/setup_php.sh
45
46   # Disable xdebug for speed (executing composer), but allow us to re-enable it later
47   # @todo move to setup_php
48   #- export XDEBUG_INI=`php -i | grep xdebug.ini | grep home/travis | grep -v '=>' | head -1`
49   #- export XDEBUG_INI=${XDEBUG_INI/,/}
50   #- if [ "$XDEBUG_INI" != "" ]; then mv "$XDEBUG_INI" "$XDEBUG_INI.bak"; fi
51
52 install:
53   - composer install
54
55 before_script:
56   # Set up Apache and Privoxy instances inside the Travis VM and use them for testing against
57   #- sudo ./tests/ci/setup/setup_apache.sh
58   #- sudo ./tests/ci/setup/setup_php.sh
59   #- sudo ./tests/ci/setup/setup_privoxy.sh
60
61   # output what version of phpunit we got going
62   - ./vendor/bin/phpunit --version
63
64 script:
65   ./vendor/bin/phpunit $COVERAGE_OPTS tests
66
67 after_failure:
68   # temp
69   - ps auxwww
70   - cat /etc/passwd
71   - sudo ls -ltr /var/log
72   - sudo ls -ltr /var/log/apache2
73   - 'sudo find /etc/apache2 | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/"'
74
75   # Save as much info as we can to help developers
76   - cat apache_error.log
77   - cat apache_access.log
78
79 after_script:
80   # Upload code-coverage to Scrutinizer
81   - if [ -f coverage.clover ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
82   - if [ -f coverage.clover ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
83   # Upload code-coverage CodeClimate - disabled as it does not support php 8 atm
84   #- if [ -f coverage.clover ]; then CODECLIMATE_REPO_TOKEN=7fa6ee01e345090e059e5e42f3bfbcc8692feb8340396382dd76390a3019ac13 ./vendor/bin/test-reporter --coverage-report=coverage.clover; fi
85
86 # reduce depth (history) of git checkout
87 git:
88     depth: 1