Created
August 13, 2018 04:36
-
-
Save mmenavas/b94d95a5f726625dc9e3dcdcd7c956be to your computer and use it in GitHub Desktop.
Travis CI file for custom Drupal 8 module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: php | |
php: | |
- '7.2' | |
env: | |
global: | |
- MODULE_NAME='example' | |
- SIMPLETEST_BASE_URL='http://127.0.0.1:8080' | |
# Ignore Symfony's deprecation notices. | |
- SYMFONY_DEPRECATIONS_HELPER=weak | |
mysql: | |
database: drupal | |
username: root | |
encoding: utf8 | |
before_install: | |
# Disable xdebug. | |
- phpenv config-rm xdebug.ini | |
install: | |
# Download and install Drupal Composer. | |
- cd .. && composer create-project drupal-composer/drupal-project:8.x-dev drupal --stability dev --no-interaction | |
- cd drupal && composer install | |
# Create symlink to add Marvel module to drupal site. | |
- ln -s $TRAVIS_BUILD_DIR web/modules/$MODULE_NAME | |
# Install Drupal via `drush si` | |
- ./vendor/bin/drush --yes site-install standard --db-url="mysql://[email protected]/drupal" | |
# Enable Marvel module | |
- ./vendor/bin/drush en $MODULE_NAME | |
# start a web server on port 8080, run in the background; wait for initialization | |
# Credit: https://github.com/sonnym/travis-ci-drupal-module-example/blob/8.x-1.x/.travis.yml | |
- ./vendor/bin/drush runserver 127.0.0.1:8080 & | |
- until netstat -an 2>/dev/null | grep '8080.*LISTEN'; do true; done | |
script: cd web && ../vendor/bin/phpunit -c core/phpunit.xml.dist modules/$MODULE_NAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment