forked from yoomoney/cms-drupal8
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Travis CI integration
- Loading branch information
Showing
3 changed files
with
121 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
language: php | ||
sudo: false | ||
|
||
php: | ||
# - 7.3 | ||
# - 7.2 | ||
- 7.1 | ||
|
||
addons: | ||
chrome: stable | ||
apt: | ||
packages: | ||
- chromium-chromedriver | ||
|
||
services: | ||
- mysql | ||
|
||
env: | ||
global: | ||
- DRUPAL_BUILD_DIR=$TRAVIS_BUILD_DIR/../drupal | ||
- SIMPLETEST_DB=mysql://root:@127.0.0.1/drupal | ||
- PATH="$PATH:$HOME/.composer/vendor/bin" | ||
matrix: | ||
# - DRUPAL_CORE=8.6.x | ||
# - DRUPAL_CORE=8.7.x | ||
- DRUPAL_CORE=8.8.x | ||
|
||
matrix: | ||
fast_finish: true | ||
|
||
mysql: | ||
database: drupal | ||
username: root | ||
encoding: utf8 | ||
|
||
# Cache composer downloads. | ||
cache: | ||
directories: | ||
- $HOME/.composer/cache | ||
|
||
before_install: | ||
# Disable xdebug. | ||
- phpenv config-rm xdebug.ini | ||
# Update composer. | ||
- composer self-update | ||
|
||
- composer global require "hirak/prestissimo:^0.3" | ||
- composer global require "drupal/coder:8.3.*" | ||
- phpcs --config-set installed_paths $HOME/.composer/vendor/drupal/coder/coder_sniffer | ||
|
||
install: | ||
# Create the database. | ||
- mysql -e 'create database drupal' | ||
|
||
# Download Drupal 8 core from the Github mirror because it is faster. | ||
- git clone --branch $DRUPAL_CORE --depth 1 https://github.com/drupal/drupal.git $DRUPAL_BUILD_DIR | ||
|
||
# Reference the module in the build site. | ||
- ln -s $TRAVIS_BUILD_DIR $DRUPAL_BUILD_DIR/modules/commerce_yandex_checkout | ||
|
||
# Copy the customized phpunit configuration file to the core directory so | ||
# the relative paths are correct. | ||
- cp $DRUPAL_BUILD_DIR/modules/commerce_yandex_checkout/phpunit.xml.dist $DRUPAL_BUILD_DIR/core/phpunit.xml | ||
|
||
# Bring in the module dependencies without requiring a merge plugin. The | ||
# require also triggers a full 'composer install'. | ||
- composer --working-dir=$DRUPAL_BUILD_DIR require drupal/commerce:^2.14 | ||
- composer --working-dir=$DRUPAL_BUILD_DIR require yandex-money/yandex-checkout-sdk-php:^1.5 | ||
|
||
# For Drupal < 8.8 we have to manually upgrade zend-stdlib to avoid PHP 7.3 | ||
# incompatibilities. | ||
- if [[ "$DRUPAL_CORE" = "8.6.x" || "$DRUPAL_CORE" = "8.7.x" ]]; | ||
then composer --working-dir=$DRUPAL_BUILD_DIR require zendframework/zend-stdlib:3.2.1; | ||
fi | ||
|
||
# For Drupal < 8.8 we have to manually upgrade phpunit to avoid PHP 7.3 | ||
# incompatibilities. | ||
- if [[ "$DRUPAL_CORE" = "8.6.x" || "$DRUPAL_CORE" = "8.7.x" ]]; | ||
then composer --working-dir=$DRUPAL_BUILD_DIR run-script drupal-phpunit-upgrade; | ||
fi | ||
|
||
# Start a web server on port 8888, run in the background; wait for | ||
# initialization. | ||
- nohup php -S localhost:8888 > /dev/null 2>&1 & | ||
|
||
# Export web server URL for browser tests. | ||
- export SIMPLETEST_BASE_URL=http://localhost:8888 | ||
|
||
before_script: | ||
# include ChromeDriver in PATH | ||
#- ln --symbolic /usr/lib/chromium-browser/chromedriver "${HOME}/bin/chromedriver" | ||
# start Chrome and listen on localhost | ||
#- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9515 http://localhost & | ||
|
||
script: | ||
- phpcs --report=full --colors --standard="Drupal,DrupalPractice" --extensions="php,module,inc,install,test,profile,theme" $TRAVIS_BUILD_DIR | ||
#- $DRUPAL_BUILD_DIR/vendor/bin/phpunit -c $DRUPAL_BUILD_DIR/core/phpunit.xml.dist --verbose $TRAVIS_BUILD_DIR |
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="tests/bootstrap.php" colors="true" | ||
beStrictAboutTestsThatDoNotTestAnything="true" | ||
beStrictAboutOutputDuringTests="true" | ||
beStrictAboutChangesToGlobalState="true" | ||
checkForUnintentionallyCoveredCode="false" | ||
verbose="true"> | ||
<php> | ||
<ini name="error_reporting" value="32767"/> | ||
<ini name="memory_limit" value="-1"/> | ||
<env name="MINK_DRIVER_ARGS_WEBDRIVER" value='["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox", "--disable-dev-shm-usage"]}}, "http://localhost:9515"]'/> | ||
</php> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">../modules/commerce_yandex_checkout</directory> | ||
<exclude> | ||
<directory suffix="Test.php">../modules/commerce_yandex_checkout</directory> | ||
<directory suffix="TestBase.php">../modules/commerce_yandex_checkout</directory> | ||
</exclude> | ||
</whitelist> | ||
</filter> | ||
</phpunit> |