72 lines
1.8 KiB
YAML
72 lines
1.8 KiB
YAML
language: php
|
|
|
|
arch:
|
|
- amd64
|
|
- ppc64le
|
|
|
|
dist: xenial
|
|
os: linux
|
|
|
|
cache:
|
|
directories:
|
|
- $HOME/.composer/cache
|
|
|
|
# PHP 5.5 and 7.4 (lowest/highest supported) are run in a separate stage with code coverage. See jobs.
|
|
php:
|
|
- 5.6
|
|
- 7.0
|
|
- 7.1
|
|
- 7.2
|
|
- 7.3
|
|
- nightly
|
|
|
|
stages:
|
|
- coding-standard
|
|
- test
|
|
- coverage
|
|
|
|
jobs:
|
|
allow_failures:
|
|
- php: nightly
|
|
include:
|
|
## SNIFF STAGE ##
|
|
- stage: coding-standard
|
|
php: 7.4
|
|
before_install:
|
|
before_script:
|
|
script: ./vendor/bin/phpcs -s
|
|
after_script:
|
|
|
|
## COVERAGE STAGE ##
|
|
# Extra builds generating code coverage on top of the standard test runs defined via the "php:" key.
|
|
- stage: coverage
|
|
php: 7.4
|
|
- php: 5.5
|
|
dist: trusty
|
|
|
|
before_install:
|
|
- sudo apt-get update -qq
|
|
- sudo apt-get install -y -qq postfix
|
|
|
|
install:
|
|
- if [[ "${TRAVIS_BUILD_STAGE_NAME^}" != "Coverage" ]]; then phpenv config-rm xdebug.ini || true; fi
|
|
- composer install --no-interaction
|
|
|
|
before_script:
|
|
- sudo service postfix stop
|
|
- smtp-sink -d "%d.%H.%M.%S" localhost:2500 1000 &
|
|
- mkdir -p build/logs
|
|
- cp test/testbootstrap-dist.php test/testbootstrap.php
|
|
- chmod +x test/fakesendmail.sh
|
|
- sudo mkdir -p /var/qmail/bin
|
|
- sudo cp test/fakesendmail.sh /var/qmail/bin/sendmail
|
|
- sudo cp test/fakesendmail.sh /usr/sbin/sendmail
|
|
- echo 'sendmail_path = "/usr/sbin/sendmail -t -i "' > $(php --ini|grep -m 1 "ini files in:"|cut -d ":" -f 2)/sendmail.ini
|
|
|
|
script:
|
|
- ./vendor/bin/phpunit --configuration ./travis.phpunit.xml.dist
|
|
|
|
after_script:
|
|
- if [[ "${TRAVIS_BUILD_STAGE_NAME^}" == "Coverage" ]]; then wget https://scrutinizer-ci.com/ocular.phar; fi
|
|
- if [[ "${TRAVIS_BUILD_STAGE_NAME^}" == "Coverage" ]]; then php ocular.phar code-coverage:upload --format=php-clover ../build/logs/clover.xml; fi
|