forked from prateeksachan/search_api_solr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
98 lines (89 loc) · 3.79 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
98
language: php
cache:
bundler: true
directories:
- $HOME/tmp/drush
- $HOME/.bundle
- $HOME/.composer
- $HOME/downloads
apt: true
git:
depth: 10000
php:
- 7.0
# - 5.6
- 5.5
# This creates a build with each php environment. 12 builds in total.
env:
# 4.5.1 is the oldest version we support
- PATH=$PATH:/home/travis/.composer/vendor/bin SOLR_VERSION=4.5.1 SOLR_CORE=d8 SOLR_CONFS="$TRAVIS_BUILD_DIR/solr-conf/4.x"
# - PATH=$PATH:/home/travis/.composer/vendor/bin SOLR_VERSION=5.4.1 SOLR_CORE=d8 SOLR_CONFS="$TRAVIS_BUILD_DIR/solr-conf/5.x"
# 5.5.0 introduced major changes for boolean operators.
- PATH=$PATH:/home/travis/.composer/vendor/bin SOLR_VERSION=5.5.1 SOLR_CORE=d8 SOLR_CONFS="$TRAVIS_BUILD_DIR/solr-conf/5.x"
- PATH=$PATH:/home/travis/.composer/vendor/bin SOLR_VERSION=6.3.0 SOLR_CORE=d8 SOLR_CONFS="$TRAVIS_BUILD_DIR/solr-conf/6.x"
notifications:
irc:
- "chat.freenode.net#drupal-search-api"
# This will create the database
mysql:
database: drupal
username: root
encoding: utf8
# To be able to run a webbrowser
# If we need anything more powerful
# than e.g. phantomjs
before_install:
- phpenv config-rm xdebug.ini
- composer self-update
- composer global require "hirak/prestissimo:^0.3"
- sudo apt-get update -qq > /dev/null
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
install:
- git tag 999.0.0
# Make sure we don't fail when checking out projects
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- echo -e "Host git.drupal.org\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
# Set sendmail so drush doesn't throw an error during site install.
- echo "sendmail_path='true'" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
# Forward the errors to the syslog so we can print them
- echo "error_log=syslog" >> `php --ini | grep "Loaded Configuration" | awk '{print $4}'`
# Get latest Drupal 8 core
- cd $TRAVIS_BUILD_DIR/..
- git clone --branch 8.2.x https://git.drupal.org/project/drupal.git
- cd $TRAVIS_BUILD_DIR/../drupal
- composer install
- composer config repositories.drupal composer https://packages.drupal.org/8
- composer config repositories.search_api_solr vcs $TRAVIS_BUILD_DIR
- composer require drupal/search_api:1.x-dev
- composer require drupal/search_api_autocomplete:1.x-dev
- composer require drupal/search_api_solr:999.0.0
- composer require drupal/facets:1.x-dev
- composer require drush/drush
# Patch template.
#########################################
# to be removed once #2824932 is resolved
#- cd modules/search_api
#- curl https://www.drupal.org/files/issues/2824932.patch | patch -p1
#- cd $TRAVIS_BUILD_DIR/../drupal
#########################################
before_script:
# Start the built-in php web server (mysql is already started) and
# suppress web-server access logs output.
- php -S localhost:8888 >& /dev/null &
# Install the site
- ./vendor/bin/drush -v site-install minimal --db-url=mysql://root:@localhost/drupal --yes
- ./vendor/bin/drush en --yes simpletest
# Install Solr
- cat $TRAVIS_BUILD_DIR/travis-solr.sh | bash
script:
# Run the tests
- cd $TRAVIS_BUILD_DIR/../drupal
- export SIMPLETEST_DB=mysql://root:@localhost/drupal
- export SIMPLETEST_BASE_URL=http://localhost:8888
- ./vendor/bin/phpunit -c core --group search_api_solr --verbose --debug | tee ; export TEST_PHPUNIT=${PIPESTATUS[0]} ; echo $TEST_PHPUNIT
# Re-enable when trying to get CodeSniffer doesn't return a 403 anymore.
#- /home/travis/.composer/vendor/bin/phpcs --standard=/home/travis/.composer/vendor/drupal/coder/coder_sniffer/Drupal --extensions=php,inc,test,module,install --ignore=css/ $TRAVIS_BUILD_DIR/../drupal/modules/search_api
# Exit the build
- echo $TEST_PHPUNIT
- if [ $TEST_PHPUNIT -eq 0 ]; then exit 0; else exit 1; fi