2017-04-04 06:02:44 +02:00
|
|
|
language: php
|
|
|
|
|
2017-09-28 23:03:30 +02:00
|
|
|
dist: trusty
|
|
|
|
|
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/.composer/cache/files
|
2017-04-04 06:02:44 +02:00
|
|
|
|
|
|
|
addons:
|
2017-05-22 03:41:00 +02:00
|
|
|
firefox: "31.0"
|
2017-04-04 06:02:44 +02:00
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- tidy
|
|
|
|
|
|
|
|
env:
|
|
|
|
global:
|
2017-05-22 03:41:00 +02:00
|
|
|
- TRAVIS_NODE_VERSION="6"
|
|
|
|
- COMPOSER_ROOT_VERSION="4.0.x-dev"
|
|
|
|
- DISPLAY=":99"
|
|
|
|
- XVFBARGS=":99 -ac -screen 0 1024x768x16"
|
2017-04-04 06:02:44 +02:00
|
|
|
|
|
|
|
matrix:
|
|
|
|
fast_finish: true
|
|
|
|
include:
|
|
|
|
# Core php tests
|
|
|
|
- php: 5.6
|
|
|
|
env:
|
|
|
|
- PHPUNIT_TEST=core
|
2017-05-22 03:41:00 +02:00
|
|
|
- DB=MYSQL
|
|
|
|
- PDO=1
|
2017-04-04 06:02:44 +02:00
|
|
|
- php: 7.1.2
|
|
|
|
env:
|
|
|
|
- PHPUNIT_TEST=core
|
2017-05-22 03:41:00 +02:00
|
|
|
- DB=PGSQL
|
2017-04-04 06:02:44 +02:00
|
|
|
# admin php tests
|
|
|
|
- php: 5.6
|
|
|
|
env:
|
|
|
|
- PHPUNIT_TEST=admin
|
2017-05-22 03:41:00 +02:00
|
|
|
- DB=PGSQL
|
2017-04-04 06:02:44 +02:00
|
|
|
- php: 7.1.2
|
|
|
|
env:
|
|
|
|
- PHPUNIT_TEST=admin
|
2017-05-22 03:41:00 +02:00
|
|
|
- DB=MYSQL
|
2017-04-04 06:02:44 +02:00
|
|
|
- PDO=1
|
2017-05-22 03:41:00 +02:00
|
|
|
# behat tests
|
|
|
|
- php: 5.6
|
|
|
|
env:
|
|
|
|
- BEHAT_TEST="@framework"
|
|
|
|
- DB=MYSQL
|
|
|
|
- php: 5.6
|
|
|
|
env:
|
|
|
|
- BEHAT_TEST="@cms"
|
|
|
|
- DB=MYSQL
|
|
|
|
- php: 5.6
|
|
|
|
env:
|
|
|
|
- BEHAT_TEST="@asset-admin"
|
|
|
|
- DB=MYSQL
|
2017-04-04 06:02:44 +02:00
|
|
|
|
|
|
|
before_script:
|
|
|
|
# Init PHP
|
|
|
|
- printf "\n" | pecl install imagick
|
|
|
|
- phpenv rehash
|
2017-09-28 23:03:30 +02:00
|
|
|
- phpenv config-rm xdebug.ini || true
|
2017-04-04 06:02:44 +02:00
|
|
|
- echo 'memory_limit = 2048M' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
|
|
|
|
|
|
|
# Install composer dependencies
|
2017-05-22 03:41:00 +02:00
|
|
|
- composer validate
|
2017-09-28 23:03:30 +02:00
|
|
|
- if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:2.0.x-dev; fi
|
|
|
|
- if [[ $BEHAT_TEST ]]; then composer require --no-update silverstripe/behat-extension:^3 silverstripe/serve:dev-master se/selenium-server-standalone:2.41.0; fi;
|
|
|
|
- composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile
|
2017-05-22 03:41:00 +02:00
|
|
|
|
|
|
|
# Start behat services
|
|
|
|
- if [[ $BEHAT_TEST ]]; then echo 'SS_BASE_URL=http://localhost:8080/' >> .env; fi
|
|
|
|
- if [[ $BEHAT_TEST ]]; then mkdir artifacts; fi
|
2017-09-28 23:03:30 +02:00
|
|
|
- if [[ $BEHAT_TEST ]]; then cp composer.lock artifacts/; fi
|
2017-05-22 03:41:00 +02:00
|
|
|
- if [[ $BEHAT_TEST ]]; then sh -e /etc/init.d/xvfb start; sleep 3; fi
|
|
|
|
- if [[ $BEHAT_TEST ]]; then (vendor/bin/selenium-server-standalone > artifacts/selenium.log 2>&1 &); fi
|
|
|
|
- if [[ $BEHAT_TEST ]]; then (vendor/bin/serve --bootstrap-file cms/tests/behat/serve-bootstrap.php &> artifacts/serve.log &); fi
|
2017-04-04 06:02:44 +02:00
|
|
|
|
|
|
|
script:
|
|
|
|
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit --testsuite $PHPUNIT_TEST; fi
|
2017-05-22 03:41:00 +02:00
|
|
|
- if [[ $BEHAT_TEST ]]; then vendor/bin/behat $BEHAT_TEST; fi
|
|
|
|
|
|
|
|
after_failure:
|
|
|
|
- if [[ $BEHAT_TEST ]]; then php ./framework/tests/behat/travis-upload-artifacts.php --if-env BEHAT_TEST,ARTIFACTS_BUCKET,ARTIFACTS_KEY,ARTIFACTS_SECRET --target-path $TRAVIS_REPO_SLUG/$TRAVIS_BUILD_ID/$TRAVIS_JOB_ID --artifacts-base-url https://s3.amazonaws.com/$ARTIFACTS_BUCKET/ --artifacts-path ./artifacts/; fi
|
2017-04-04 06:02:44 +02:00
|
|
|
|
|
|
|
notifications:
|
|
|
|
slack: silverstripeltd:Cls1xnypKBLFhv0YIRtNLzlQ
|