-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
263c924
commit a9bb773
Showing
2 changed files
with
14 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,19 @@ | ||
language: php | ||
version: ~> 1.0 | ||
|
||
dist: xenial | ||
|
||
services: | ||
- mysql | ||
- postgresql | ||
- xvfb | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- tidy | ||
- chromium-chromedriver | ||
- chromium-browser | ||
|
||
install: | ||
- sudo apt-get remove -y --purge google-chrome-stable || true | ||
import: | ||
- silverstripe/silverstripe-travis-shared:config/provision/standard-jobs-fixed-behat.yml | ||
|
||
env: | ||
global: | ||
- COMPOSER_ROOT_VERSION=3.x-dev | ||
- SS_BASE_URL="http://localhost:8080/" | ||
- SS_ENVIRONMENT_TYPE="dev" | ||
- RECIPE_CMS_VERSION=4.x-dev | ||
|
||
matrix: | ||
fast_finish: true | ||
include: | ||
- php: 7.1 | ||
env: DB=PGSQL PHPUNIT_TEST=1 PHPCS_TEST=1 COMPOSER_ARG=--prefer-lowest | ||
- php: 7.2 | ||
env: DB=MYSQL PHPUNIT_TEST=1 | ||
- php: 7.3 | ||
env: DB=MYSQL PDO=1 PHPUNIT_COVERAGE_TEST=1 | ||
- php: 7.4 | ||
env: DB=MYSQL PHPUNIT_TEST=1 | ||
- php: 7.3 | ||
env: DB=MYSQL BEHAT_TEST=1 | ||
- php: 7.3 | ||
env: DB=MYSQL ASSETADMIN_TEST=1 | ||
- php: nightly | ||
env: DB=MYSQL PHPUNIT_TEST=1 COMPOSER_ARG=--ignore-platform-reqs | ||
- COMPOSER_ROOT_VERSION="3.4.x-dev" | ||
- REQUIRE_RECIPE="4.7.x-dev" | ||
- REQUIRE_EXTRA="silverstripe/frameworktest:0.1.0" | ||
- BEHAT_SUITE="asset-admin --config vendor/silverstripe/asset-admin/behat.yml" | ||
|
||
before_script: | ||
# Extra $PATH | ||
- export PATH=/usr/lib/chromium-browser/:$PATH | ||
|
||
# Init PHP | ||
- composer self-update || true | ||
- phpenv rehash | ||
- phpenv config-rm xdebug.ini || true | ||
|
||
# Install composer dependencies | ||
- composer validate | ||
- if [[ (! $BEHAT_TEST) && (! $ASSETADMIN_TEST) ]]; then composer require --prefer-dist --no-update silverstripe/recipe-core:4.x-dev silverstripe/versioned:1.x-dev silverstripe/assets:1.x-dev --prefer-dist ; fi | ||
- if [[ $DB == PGSQL ]]; then composer require silverstripe/postgresql:2.x-dev --prefer-dist --no-update; fi | ||
- if [[ $ASSETADMIN_TEST ]]; then composer require silverstripe/recipe-cms $RECIPE_CMS_VERSION --prefer-source --no-update ; fi | ||
- if [[ $BEHAT_TEST ]]; then composer require silverstripe/recipe-testing:^1 silverstripe/recipe-cms $RECIPE_CMS_VERSION silverstripe/frameworktest:^0.1.0 --prefer-source --no-update ; fi | ||
- composer update $COMPOSER_ARG | ||
|
||
- if [[ $BEHAT_TEST ]]; then mkdir artifacts; fi | ||
- if [[ $BEHAT_TEST ]]; then cp composer.lock artifacts/; fi | ||
- if [[ $BEHAT_TEST ]]; then (chromedriver > artifacts/chromedriver.log 2>&1 &); fi | ||
- if [[ $BEHAT_TEST ]]; then (vendor/bin/serve --bootstrap-file vendor/silverstripe/cms/tests/behat/serve-bootstrap.php &> artifacts/serve.log &); fi | ||
|
||
script: | ||
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi | ||
- if [[ $PHPCS_TEST ]]; then composer run-script lint; fi | ||
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml -vvv; fi | ||
- if [[ $BEHAT_TEST ]]; then vendor/bin/behat @asset-admin --config vendor/silverstripe/asset-admin/behat.yml ; fi | ||
- if [[ $ASSETADMIN_TEST ]]; then vendor/bin/phpunit vendor/silverstripe/asset-admin/tests; fi | ||
|
||
after_success: | ||
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi | ||
# separately create artifacts directory for asset-admin behat test | ||
- if [[ $BEHAT_TEST ]]; then mkdir ./vendor/silverstripe/asset-admin/artifacts; fi | ||
|
||
after_failure: | ||
- php ./vendor/silverstripe/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/ | ||
# upload artifacts from asset-admin behat test | ||
- if [[ $BEHAT_TEST ]]; then php ./vendor/silverstripe/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 ./vendor/silverstripe/asset-admin/artifacts/; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters