Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TravisCI testing #4136

Merged
merged 33 commits into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 52 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,74 @@ sudo: false
language: php

php:
- 5.5.9
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- hhvm
- 7.4snapshot

services:
- mysql

matrix:
include:
- php: 5.5.9
dist: trusty
fast_finish: true
allow_failures:
- php: hhvm
- php: 7.4snapshot

env:
global:
- PROJECT_DIR=/home/project
# Paths.
- DRUPAL_PATH="$HOME/drupal8"
- PATH="$PATH:$DRUPAL_PATH/vendor/bin:$HOME/.composer/vendor/bin"

# Suppress deprecation handling.
#- SYMFONY_DEPRECATIONS_HELPER=disabled

mysql:
database: drupal_travis_db
username: root
encoding: utf8

before_script:
- phpenv config-rm xdebug.ini
# This fixes a fail when install Drupal.
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- composer self-update
- composer install --no-dev
# - curl -LSs https://box-project.github.io/box2/installer.php | php
# - composer global require drupal/coder:~8.1
- phpenv config-rm xdebug.ini || true

# Set variables.
- |
if [[ "$TRAVIS_PHP_VERSION" == "5.5.9" ]] || [[ "$TRAVIS_PHP_VERSION" == "5.6" ]]; then
export DRUPAL_BRANCH="8.6.x"
# PHP 5.5.9 on TravisCI has a Sqlite version that fails
# minimum requirements, so we install on MySql instead.
export SIMPLETEST_DB="mysql://root:@localhost/drupal_travis_db#drupalconsole"
else
export DRUPAL_BRANCH="8.8.x"
export SIMPLETEST_DB="sqlite://localhost/sites/default/files/.ht.sqlite#drupalconsole"
fi

# Get Drupal via git, and install it via Composer. Then, require
# latest drupal/console at its master branch via Composer.
- git clone --depth=50 --branch=$DRUPAL_BRANCH http://git.drupal.org/project/drupal.git $DRUPAL_PATH
- cd $DRUPAL_PATH
- composer install --no-progress --no-suggest
- composer require "drupal/console:dev-master" --no-progress --no-suggest

# Replace vendor/drupal/console with the one just being built from GitHub.
- rm -rf $DRUPAL_PATH/vendor/drupal/console
- mkdir -p $DRUPAL_PATH/vendor/drupal/console
- cp -r $TRAVIS_BUILD_DIR/* $DRUPAL_PATH/vendor/drupal/console
# Update drupal/console dependencies in case they have been changed in the
# current build.
- composer update drupal/console

script:
- if [ -n "${TRAVIS_BUILD_DIR+1}" ]; then PROJECT_DIR=$TRAVIS_BUILD_DIR; fi
# - phpunit
# - php box.phar build
# - php drupal.phar init
# - php drupal.phar check
# - php drupal.phar site:new drupal8.dev --latest --no-interaction
# - cd drupal8.dev
# - php ../drupal.phar site:install standard --langcode=en --db-type=sqlite --db-file=sites/default/files/.ht.sqlite --site-name="Drupal 8 Site Install" --site-mail=admin@example.com --account-name=admin --account-mail=admin@example.com --account-pass=admin --no-interaction
# - php ../drupal.phar chain --file=$PROJECT_DIR/config/dist/chain/sample.yml
# Install Drupal site via drupal/console and show site status.
- drupal site:install standard $SIMPLETEST_DB --langcode=en --site-name="Drupal 8 Site Install" --site-mail=admin@example.com --account-name=admin --account-mail=admin@example.com --account-pass=admin --no-interaction
- drupal site:status -v
# - cd $DRUPAL_PATH/vendor/drupal/console
# - ../../phpunit/phpunit/phpunit
# - ~/.composer/vendor/bin/phpcs --warning-severity=0 --standard=~/.composer/vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml $PROJECT_DIR/drupal8.dev/modules/custom/example

notifications:
Expand Down
2 changes: 1 addition & 1 deletion autoload.local.php.dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<?php

$autoloaders = [ getcwd() . '/vendor/autoload.php' ];
$autoloaders = [ getcwd() . '/../../autoload.php' ];
2 changes: 1 addition & 1 deletion autoload.php.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$loader = require __DIR__ . '/vendor/autoload.php';
$loader = require __DIR__ . '/../../autoload.php';

$loader->setPsr4('Drupal\\Console\\Test\\', __DIR__ . '/Test');

Expand Down