-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
99 lines (80 loc) · 3.64 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
99
language: php
sudo: required
dist: bionic
php:
- 7.1
- 7.2
- 7.3
- 7.4
addons:
chrome: stable
services:
- mysql
- xvfb
mysql:
database: drupal
username: root
encoding: utf8
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- wget http://chromedriver.storage.googleapis.com/83.0.4103.39/chromedriver_linux64.zip && unzip chromedriver_linux64.zip && sudo mv chromedriver /usr/bin
install:
# Set unlimited memory_limit.
- INI_FILE=~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo "memory_limit = -1" >> "${INI_FILE}"
# Remove xdebug for the moment. We aren't generating code coverage, and it slows us down.
- mv ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini /tmp/xdebug.ini
before_script:
# Create drupal database.
- mysql -u root -e "CREATE DATABASE drupal;"
# Set up DB user.
- mysql -uroot -e "CREATE USER drupal@localhost IDENTIFIED BY 'drupal';"
- mysql -uroot -e "GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES ON drupal.* TO 'drupal'@'localhost' IDENTIFIED BY 'drupal';"
# Set github access token for composer if available.
- if [[ $GITHUB_OAUTH_TOKEN ]]; then git config --global github.accesstoken $GITHUB_OAUTH_TOKEN; fi
# Copy module to tmp dir for later use.
- mkdir /tmp/bee; cp -r * /tmp/bee
# Update composer.
- composer -n self-update
# Install drush.
- export PATH="$HOME/.composer/vendor/bin:$PATH"
- composer -n global require drush/drush:8.*
# Install code sniffer.
- composer -n global require drupal/coder
# Register Drupal coding standards.
- phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer
# Don't display warnings.
- phpcs --config-set show_warnings 0
# Make the site.
- cd $TRAVIS_BUILD_DIR
- drush make test/project.make bee
# Copy the bee module into the Drupal site.
- mkdir -p bee/sites/all/modules/bee
- mv /tmp/bee bee/sites/all/modules/bee
# Install BAT library.
- cd $TRAVIS_BUILD_DIR/bee
- composer require "roomify/bat"
# Install RRULE library.
- composer require "rlanvin/php-rrule"
- php -d sendmail_path=$(which true) ~/.composer/vendor/bin/drush.php --yes site-install --db-url=mysql://drupal:[email protected]/drupal --account-name=admin --account-pass=test [email protected] --site-name="bee"
# Following step with -y should also run composer install.
- drush -y en bat bat_api bat_calendar_reference bat_event bat_event_ui bat_facets bat_fullcalendar bat_unit bee bee_webform
- drush cr all --yes
script:
- if [ "${TRAVIS_PHP_VERSION}" == '7.3' ]; then composer global require mglaman/drupal-check; fi;
# Run drupal-check
- cd $TRAVIS_BUILD_DIR/bee/sites/all/modules/bee/bee
- if [ "${TRAVIS_PHP_VERSION}" == '7.3' ]; then drupal-check -ad bee.module; fi;
- if [ "${TRAVIS_PHP_VERSION}" == '7.3' ]; then drupal-check -ad bee.install; fi;
- if [ "${TRAVIS_PHP_VERSION}" == '7.3' ]; then drupal-check -ad src; fi;
- if [ "${TRAVIS_PHP_VERSION}" == '7.3' ]; then drupal-check -ad modules; fi;
# Check coding standards.
- phpcs --standard=Drupal --exclude=Drupal.Arrays.Array,Drupal.Commenting.FunctionComment,Drupal.Commenting.DocComment,Drupal.Commenting.FileComment,Drupal.NamingConventions.ValidFunctionName,Drupal.NamingConventions.ValidVariableName,Drupal.InfoFiles.AutoAddedKeys,Drupal.InfoFiles.ClassFiles --report-width=74 --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml --ignore=test $TRAVIS_BUILD_DIR/bee/sites/all/modules/bee
# Cache composer/drush files
cache:
directories:
- $HOME/.cache
- $HOME/.composer/cache
- vendor
- $HOME/.drush/cache