# The Travis setup: # - run testsuite for every PHP version # - run lint for every PHP version # - run Selenium for single PHP version dist: xenial language: php services: - mysql php: - "7.3" - "7.2" - "7.1" - "7.0" - "5.6" - "hhvm-3.12" - "hhvm-3.18" - "hhvm-3.21" - "hhvm-3.24" - "hhvm-3.27" env: matrix: - CI_MODE=test global: - TESTSUITE_USER=root - TESTSUITE_URL=http://127.0.0.1:8000 install: - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then source ~/virtualenv/python3.6/bin/activate ; fi - ./test/ci-install-$CI_MODE - if [[ "$TRAVIS_OS_NAME" != "osx" ]]; then case "$TRAVIS_PHP_VERSION" in hhvm*) ;; *) phpenv config-add test/php-noprofile.ini ;; esac ; fi before_script: - export TESTSUITE_PASSWORD=`openssl rand -base64 30` - export TESTSUITE_BROWSERSTACK_KEY=`echo cHlDcHJTNmZwZjVlaUR2RmV6VkU= | base64 --decode` - export PATH=~/.composer/vendor/bin/:$PATH - mysql -uroot -e "CREATE DATABASE IF NOT EXISTS test" - mysql -uroot < sql/create_tables.sql - mysql -uroot -e "SET PASSWORD = PASSWORD('$TESTSUITE_PASSWORD')" - ./test/start-local-server script: - ./scripts/generate-mo --quiet - if [ $CI_MODE = test ] ; then ./test/ci-lint ; fi - ./test/ci-$CI_MODE after_script: - if [ -f vendor/bin/codacycoverage ] ; then php vendor/bin/codacycoverage clover || true ; fi - if [ -f php.log ] ; then cat php.log ; fi - if [ -f nginx-error.log ] ; then cat nginx-error.log ; fi - if [ -f build/logs/phpunit.json ] ; then ./scripts/phpunit-top-tests build/logs/phpunit.json ; fi - if [ -f config.inc.php ] ; then rm -rf config.inc.php; fi after_success: - bash <(curl -s https://codecov.io/bash) matrix: fast_finish: true include: - php: "7.1" env: CI_MODE=selenium before_install: phpenv config-rm xdebug.ini - php: "7.0" node_js: 10 env: CI_MODE=release - php: "7.1" env: CI_MODE=docs - php: "7.1" env: CI_MODE=apidocs before_install: phpenv config-rm xdebug.ini - os: osx name: "PHP 7.4" language: node_js node_js: 10 env: CI_MODE=test before_install: - brew link --force gettext - echo "memory_limit=-1" > /usr/local/etc/php/7.4/conf.d/50-travis.ini - echo "pcre.jit=0" >> /usr/local/etc/php/7.4/conf.d/50-travis.ini - mysql.server start - sleep 5 # Enable password access - mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');" install: - composer require --no-interaction php>=7.1 - composer remove phpunit/phpunit-selenium --dev --no-interaction - composer remove phpunit/phpunit --dev --no-interaction - composer require --dev --no-interaction phpunit/phpunit ^8 - rm -rf test/selenium - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i.bak~ 's/function setUpBeforeClass()/function setUpBeforeClass(): void/g'" - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i.bak~ 's/function setUp()/function setUp(): void/g'" - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i.bak~ 's/function tearDown()/function tearDown(): void/g'" addons: homebrew: packages: - php - composer - mariadb update: true - php: "5.5" env: CI_MODE=test dist: trusty script: - ./scripts/generate-mo --quiet - ./vendor/bin/phpunit --configuration phpunit.xml.dist --exclude-group selenium,git-revision,network - php: "7.3" env: CI_MODE=test name: "Run tests using phpunit 8" install: - composer require --no-interaction php>=7.1 - composer remove phpunit/phpunit-selenium --dev --no-interaction - composer remove phpunit/phpunit --dev --no-interaction - composer require --dev --no-interaction phpunit/phpunit ^8 - rm -rf test/selenium - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i 's/function setUpBeforeClass()/function setUpBeforeClass(): void/g'" - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i 's/function setUp()/function setUp(): void/g'" - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i 's/function tearDown()/function tearDown(): void/g'" - php: "7.4" env: CI_MODE=test name: "PHP: 7.4" install: - composer require --no-interaction php>=7.1 - composer remove phpunit/phpunit-selenium --dev --no-interaction - composer remove phpunit/phpunit --dev --no-interaction - composer require --dev --no-interaction phpunit/phpunit ^8 - rm -rf test/selenium - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i 's/function setUpBeforeClass()/function setUpBeforeClass(): void/g'" - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i 's/function setUp()/function setUp(): void/g'" - "find test/ -type f -iname '*.php' -print0 | xargs -0 sed -i 's/function tearDown()/function tearDown(): void/g'" - phpenv config-rm xdebug.ini - php: "7.1" env: CI_MODE=test DBASE=true install: - pecl channel-update pecl.php.net - pecl install dbase - test/ci-install-test - php: "5.6" env: CI_MODE=test DBASE=true install: - pecl channel-update pecl.php.net - pecl install dbase-5.1.1 - test/ci-install-test - php: "nightly" env: CI_MODE=test install: - composer install --no-interaction --ignore-platform-reqs - php: "7.1" before_script: skip after_script: skip after_success: skip script: - test/ci-lint - vendor/bin/phpcs --standard=phpcs.xml.dist allow_failures: - os: osx - php: "nightly" - env: CI_MODE=test DBASE=true - env: CI_MODE=docs cache: pip: true directories: - $HOME/.composer/cache/ - $HOME/browserstack - $HOME/runkit # Install APT packages # - git > 2.5.1 needed for worktrees # - mysql server does not seem to be always present on Travis Trusty environment addons: apt: packages: - git - nginx