forked from yoomoney/cms-drupal8
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
97 lines (77 loc) · 3.01 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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