2017-04-04 06:02:44 +02:00
|
|
|
language: php
|
|
|
|
|
2017-09-28 23:03:30 +02:00
|
|
|
dist: trusty
|
|
|
|
|
2018-04-12 23:27:25 +02:00
|
|
|
before_install:
|
|
|
|
- sudo apt-get update
|
|
|
|
- sudo apt-get install chromium-chromedriver
|
2017-12-19 00:07:04 +01:00
|
|
|
|
2017-09-28 23:03:30 +02:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/.composer/cache/files
|
2017-04-04 06:02:44 +02:00
|
|
|
|
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages:
|
|
|
|
- tidy
|
|
|
|
|
|
|
|
env:
|
|
|
|
global:
|
2017-05-22 03:41:00 +02:00
|
|
|
- TRAVIS_NODE_VERSION="6"
|
2018-02-07 04:43:17 +01:00
|
|
|
- COMPOSER_ROOT_VERSION="4.1.x-dev"
|
2017-05-22 03:41:00 +02:00
|
|
|
- DISPLAY=":99"
|
|
|
|
- XVFBARGS=":99 -ac -screen 0 1024x768x16"
|
2018-04-12 23:27:25 +02:00
|
|
|
- SS_BASE_URL="http://localhost:8080/"
|
|
|
|
- SS_ENVIRONMENT_TYPE="dev"
|
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
|
2019-02-02 09:22:56 +01:00
|
|
|
- php: 7.1
|
|
|
|
env:
|
|
|
|
- PHPUNIT_TEST=framework
|
|
|
|
- DB=MYSQL
|
|
|
|
- php: 7.3
|
2017-04-04 06:02:44 +02:00
|
|
|
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
|
2019-02-02 09:22:56 +01:00
|
|
|
- php: 7.0
|
2017-04-04 06:02:44 +02:00
|
|
|
env:
|
|
|
|
- PHPUNIT_TEST=admin
|
2017-05-22 03:41:00 +02:00
|
|
|
- DB=PGSQL
|
2019-02-02 09:22:56 +01:00
|
|
|
- php: 7.2
|
2017-04-04 06:02:44 +02:00
|
|
|
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
|
2017-12-20 00:02:00 +01:00
|
|
|
- php: 7.0
|
2017-05-22 03:41:00 +02:00
|
|
|
env:
|
|
|
|
- BEHAT_TEST="@framework"
|
|
|
|
- DB=MYSQL
|
2017-12-20 00:02:00 +01:00
|
|
|
- php: 7.0
|
2017-05-22 03:41:00 +02:00
|
|
|
env:
|
|
|
|
- BEHAT_TEST="@cms"
|
|
|
|
- DB=MYSQL
|
2017-12-20 00:02:00 +01:00
|
|
|
- php: 7.0
|
2017-05-22 03:41:00 +02:00
|
|
|
env:
|
|
|
|
- BEHAT_TEST="@asset-admin"
|
|
|
|
- DB=MYSQL
|
2017-12-21 03:53:41 +01:00
|
|
|
- php: 5.6
|
|
|
|
env:
|
|
|
|
- HEALTH_TEST=1
|
|
|
|
- DB=MYSQL
|
|
|
|
- PDO=1
|
2017-04-04 06:02:44 +02:00
|
|
|
|
|
|
|
before_script:
|
2018-04-12 23:27:25 +02:00
|
|
|
# Extra $PATH
|
|
|
|
- export PATH=/usr/lib/chromium-browser/:$PATH
|
|
|
|
|
2017-04-04 06:02:44 +02:00
|
|
|
# Init PHP
|
|
|
|
- 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
|
2018-04-12 23:27:25 +02:00
|
|
|
- if [[ $BEHAT_TEST ]]; then composer require --no-update silverstripe/recipe-testing:^1; fi;
|
2017-12-21 03:53:41 +01:00
|
|
|
- if [[ $HEALTH_TEST ]]; then composer require --no-update silverstripe/serve:^2; fi;
|
2018-12-18 04:38:40 +01:00
|
|
|
- if ! [[ $HEALTH_TEST ]]; then composer install --prefer-source --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile; fi;
|
2017-12-21 03:53:41 +01:00
|
|
|
- if [[ $HEALTH_TEST ]]; then composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile --no-dev; fi;
|
2017-05-22 03:41:00 +02:00
|
|
|
|
|
|
|
# Start behat services
|
2017-12-21 03:53:41 +01:00
|
|
|
- if [[ $BEHAT_TEST ]] || [[ $HEALTH_TEST ]]; then mkdir artifacts; fi
|
|
|
|
- if [[ $BEHAT_TEST ]] || [[ $HEALTH_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
|
2018-04-12 23:27:25 +02:00
|
|
|
- if [[ $BEHAT_TEST ]]; then (chromedriver > artifacts/chromedriver.log 2>&1 &); fi
|
2017-12-21 03:53:41 +01:00
|
|
|
- if [[ $BEHAT_TEST ]] || [[ $HEALTH_TEST ]]; then (vendor/bin/serve --bootstrap-file vendor/silverstripe/cms/tests/behat/serve-bootstrap.php &> artifacts/serve.log &); sleep 3; 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
|
2017-12-21 03:53:41 +01:00
|
|
|
- if [[ $HEALTH_TEST ]]; then curl -vfL http://localhost:8080/dev/build?flush; fi
|
|
|
|
- if [[ $HEALTH_TEST ]]; then curl -vfL http://localhost:8080/admin; fi
|
2017-05-22 03:41:00 +02:00
|
|
|
|
|
|
|
after_failure:
|
2017-12-21 03:53:41 +01:00
|
|
|
- if [[ $BEHAT_TEST ]] || [[ $HEALTH_TEST ]]; then php ./vendor/silverstripe/framework/tests/behat/travis-upload-artifacts.php --if-env 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:
|
2018-11-21 09:10:41 +01:00
|
|
|
slack:
|
|
|
|
on_pull_requests: false
|
|
|
|
rooms:
|
|
|
|
secure: pr4kG5tTMqZy1DLejHd1MpPulAE7FtRvTYekWrKIbQF0SkbFz+s3v9fAk2AqCr+SxfV67M3M+sL52/q6TDjeGYJJttwA60gyfH/Qrc/ToCYP3J80Ca/hsk02mya0pF8Kpjg37XP8kNzAllR162mCwYKJgFiXO6Q1eb/aVJwiqmQ=
|