mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
.travis.yml code cleanup
Fixed indentation Move coverage build to script Update travis node version to 6 Update npm to use yarn for CI
This commit is contained in:
parent
1efb325b4d
commit
fc2219dc72
66
.travis.yml
66
.travis.yml
@ -12,9 +12,10 @@ addons:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- TRAVIS_NODE_VERSION="4"
|
- TRAVIS_NODE_VERSION="6"
|
||||||
- CORE_RELEASE=4
|
|
||||||
- COMPOSER_ROOT_VERSION="4.0.x-dev"
|
- COMPOSER_ROOT_VERSION="4.0.x-dev"
|
||||||
|
- DISPLAY=":99"
|
||||||
|
- XVFBARGS=":99 -ac -screen 0 1024x768x16"
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
@ -30,41 +31,40 @@ matrix:
|
|||||||
env: NPM_TEST=1
|
env: NPM_TEST=1
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- "if [ \"$PHPCS_TEST\" = \"1\" ]; then pyrus install pear/PHP_CodeSniffer; fi"
|
# Init PHP
|
||||||
- phpenv rehash
|
- if [[ $PHPCS_TEST ]]; then pyrus install pear/PHP_CodeSniffer; fi
|
||||||
- phpenv config-rm xdebug.ini
|
- phpenv rehash
|
||||||
- echo 'memory_limit = 2G' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
- phpenv config-rm xdebug.ini
|
||||||
- composer install --prefer-dist
|
- echo 'memory_limit = 2G' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
||||||
- composer require --update-with-dependencies silverstripe/framework:4.0.x-dev silverstripe/config:1.0.x-dev silverstripe/admin:1.0.x-dev silverstripe/assets:1.0.x-dev silverstripe/versioned:1.0.x-dev --prefer-dist
|
|
||||||
- "if [ \"$DB\" = \"PGSQL\" ]; then composer require silverstripe/postgresql:2.0.x-dev --prefer-dist; fi"
|
# Install composer dependencies
|
||||||
- "if [ \"$DB\" = \"SQLITE\" ]; then composer require silverstripe/sqlite3:2.0.x-dev --prefer-dist; fi"
|
- composer install --prefer-dist
|
||||||
- "php ./tests/bootstrap/mysite.php"
|
- composer require --update-with-dependencies silverstripe/framework:4.0.x-dev silverstripe/config:1.0.x-dev silverstripe/admin:1.0.x-dev silverstripe/assets:1.0.x-dev silverstripe/versioned:1.0.x-dev --prefer-dist
|
||||||
- "export DISPLAY=\":99\""
|
- if [[ $DB == PGSQL ]]; then composer require silverstripe/postgresql:2.0.x-dev --prefer-dist; fi
|
||||||
- "export XVFBARGS=\":99 -ac -screen 0 1024x768x16\""
|
- if [[ $DB == SQLITE ]]; then composer require silverstripe/sqlite3:2.0.x-dev --prefer-dist; fi
|
||||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then (nvm install $TRAVIS_NODE_VERSION && npm install --silent && npm run build); fi"
|
|
||||||
- "if [[ $BEHAT_TEST ]]; then echo 'SS_BASE_URL=http://localhost:8080/' >> .env; fi"
|
# Bootstrap cms / mysite folder
|
||||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then sh -e /etc/init.d/xvfb start; sleep 3; fi"
|
- php ./tests/bootstrap/mysite.php
|
||||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then (vendor/bin/selenium-server-standalone > selenium.log 2>&1 &); fi"
|
|
||||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then (vendor/bin/serve --bootstrap-file tests/behat/serve-bootstrap.php &> serve.log &); fi"
|
# Install NPM dependencies
|
||||||
|
- if [[ $NPM_TEST ]]; then nvm install $TRAVIS_NODE_VERSION && nvm use $TRAVIS_NODE_VERSION && npm install -g yarn && yarn install --network-concurrency 1 && yarn run build; fi
|
||||||
|
|
||||||
|
# Start behat services
|
||||||
|
- if [[ $BEHAT_TEST ]]; then echo 'SS_BASE_URL=http://localhost:8080/' >> .env; fi
|
||||||
|
- if [[ $BEHAT_TEST ]]; then sh -e /etc/init.d/xvfb start; sleep 3; fi
|
||||||
|
- if [[ $BEHAT_TEST ]]; then (vendor/bin/selenium-server-standalone > selenium.log 2>&1 &); fi
|
||||||
|
- if [[ $BEHAT_TEST ]]; then (vendor/bin/serve --bootstrap-file tests/behat/serve-bootstrap.php &> serve.log &); fi
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- "if [ \"$PHPUNIT_TEST\" = \"1\" ]; then vendor/bin/phpunit tests flush=1; fi"
|
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit tests flush=1; fi
|
||||||
- "if [ \"$BEHAT_TEST\" = \"1\" ]; then vendor/bin/behat @cms; fi"
|
- if [[ $BEHAT_TEST ]]; then vendor/bin/behat @cms; fi
|
||||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then git diff-files --quiet -w --relative=client; fi"
|
- if [[ $NPM_TEST ]]; then git diff-files --quiet -w --relative=client; fi
|
||||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then git diff -w --no-color --relative=client; fi"
|
- if [[ $NPM_TEST ]]; then git diff -w --no-color --relative=client; fi
|
||||||
- "if [ \"$NPM_TEST\" = \"1\" ]; then (nvm use $TRAVIS_NODE_VERSION && npm run lint); fi"
|
- if [[ $NPM_TEST ]]; then yarn run lint; fi
|
||||||
- "if [ \"$PHPCS_TEST\" = \"1\" ]; then composer run-script lint; fi"
|
- if [[ $PHPCS_TEST ]]; then composer run-script lint; fi
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- "if [ \"$PHPUNIT_COVERAGE_TEST\" = \"1\" ]; then vendor/bin/phpunit tests flush=1 --coverage-clover=coverage.xml; fi"
|
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi
|
||||||
- "if [ \"$PHPUNIT_COVERAGE_TEST\" = \"1\" ]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi"
|
|
||||||
|
|
||||||
after_failure:
|
after_failure:
|
||||||
- php ~/travis-support/travis_upload_artifacts.php --if-env BEHAT_TEST,ARTIFACTS_KEY --target-path $TRAVIS_REPO_SLUG/$TRAVIS_BUILD_ID/$TRAVIS_JOB_ID --artifacts-base-url https://s3.amazonaws.com/$ARTIFACTS_BUCKET/
|
- php ~/travis-support/travis_upload_artifacts.php --if-env BEHAT_TEST,ARTIFACTS_KEY --target-path $TRAVIS_REPO_SLUG/$TRAVIS_BUILD_ID/$TRAVIS_JOB_ID --artifacts-base-url https://s3.amazonaws.com/$ARTIFACTS_BUCKET/
|
||||||
|
|
||||||
branches:
|
|
||||||
except:
|
|
||||||
- 2.1
|
|
||||||
- 2.2
|
|
||||||
- 2.3
|
|
||||||
- translation-staging
|
|
||||||
|
Loading…
Reference in New Issue
Block a user