-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
67 lines (60 loc) · 2.22 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
language: php
sudo: false
dist: bionic
php:
- 7.2
# Use a recent version of npm. Local dependencies don't work Travis default.
node:
- 11
# Cypress requires libgconf-2-4
addons:
apt:
packages:
- libgconf-2-4
env:
global:
- DRUPAL_CYPRESS=on
- DRUPAL_TEST_DB_URL=sqlite://localhost/sites/default/files/test.sqlite
- SIMPLETEST_DB=sqlite://localhost/sites/default/files/test.sqlite
- DRUPAL_TEST_BASE_URL=http://localhost:8888
- TRAVIS=true
- DRUPAL_VERSION=8.8.5
- DRUPAL_BUILD_DIR=$TRAVIS_BUILD_DIR/../drupal-$DRUPAL_VERSION
- PATH=$PATH:$DRUPAL_BUILD_DIR/vendor/bin
# Cache composer downloads.
cache:
directories:
- $HOME/.composer
- $DRUPAL_BUILD_DIR/drupal-cypress-environment/node_modules
- $HOME/.cache/Cypress
before_install:
# Disable xdebug.
- phpenv config-rm xdebug.ini
# Composer setup
- composer self-update
# Download and unpack Drupal
- curl -O https://ftp.drupal.org/files/projects/drupal-$DRUPAL_VERSION.tar.gz
- tar -xf drupal-$DRUPAL_VERSION.tar.gz -C $TRAVIS_BUILD_DIR/../
install:
# Install Drupal development dependencies.
- composer --working-dir=$DRUPAL_BUILD_DIR install
# Install Drush
- composer --working-dir=$DRUPAL_BUILD_DIR require drush/drush:^10 alchemy/zippy
# Upgrade phpunit to work with PHP 7
- composer --working-dir=$DRUPAL_BUILD_DIR require phpunit/phpunit:^7 symfony/phpunit-bridge phpspec/prophecy sebastian/global-state:^2 sebastian/environment:^3.1 phpunit/php-code-coverage:^6 mikey179/vfsstream
# Reference the module in the build site.
- ln -s $TRAVIS_BUILD_DIR $DRUPAL_BUILD_DIR/modules/cypress
- ln -s $TRAVIS_BUILD_DIR/tests/features $DRUPAL_BUILD_DIR/features
script:
- cp $TRAVIS_BUILD_DIR/example.testing.services.yml $DRUPAL_BUILD_DIR/sites/default/testing.services.yml
- cd $DRUPAL_BUILD_DIR
# Do a minimal Drupal installation. Required for drush.
- php core/scripts/drupal install -q minimal
# Run a simple http server on port 8888
- ./vendor/bin/drush serve -q &
# Run Drupal Unit tests in this module.
- ./vendor/bin/phpunit -c core/phpunit.xml.dist modules/cypress
# Enable the cypress module
- ./vendor/bin/drush en cypress
# Run all Cypress tests
- ./vendor/bin/drush cypress:run -y