.travis.yml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. language: php
  2. sudo: false
  3. php:
  4. - 5.5
  5. - 5.6
  6. - 7.0
  7. - hhvm
  8. matrix:
  9. fast_finish: true
  10. allow_failures:
  11. - php: hhvm
  12. mysql:
  13. database: drupal
  14. username: root
  15. encoding: utf8
  16. install:
  17. # add composer's global bin directory to the path
  18. # see: https://github.com/drush-ops/drush#install---composer
  19. - export PATH="$HOME/.composer/vendor/bin:$PATH"
  20. # install drush globally
  21. - composer global require drush/drush:7.*
  22. # Install PHP_CodeSniffer and Drupal config
  23. - composer global require drupal/coder
  24. - phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer
  25. # Create the database
  26. - mysql -e 'create database drupal;'
  27. before_script:
  28. # Disable sendmail
  29. - echo sendmail_path=`which true` >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  30. # Increase the MySQL connection timeout on the PHP end.
  31. - echo "mysql.connect_timeout=3000" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  32. - echo "default_socket_timeout=3000" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  33. # Increase the MySQL server timetout and packet size.
  34. - mysql -e "SET GLOBAL wait_timeout = 36000;"
  35. - mysql -e "SET GLOBAL max_allowed_packet = 33554432;"
  36. # Download Drupal 7.x
  37. - drush pm-download drupal-7 --destination=/tmp --drupal-project-rename=drupal
  38. # Add our module
  39. - ln -s $(pwd) /tmp/drupal/sites/all/modules/
  40. # Switch to the drupal site directory
  41. - cd /tmp/drupal
  42. # Install site and dependencies
  43. - drush -vv --yes site-install --db-url=mysql://root:@127.0.0.1/drupal
  44. - drush pm-download entity
  45. - drush pm-enable simpletest entity uuid --yes
  46. # Use the PHP builtin webserver to serve the site.
  47. #- drush runserver 8080 > /dev/null 2>&1 &
  48. - drush runserver 127.0.0.1:8888 > ~/server.log 2>&1 &
  49. - export counter=0; until nc -zv localhost 8888; do if [ $counter -ge 12 ]; then echo "Failed to start server."; exit 1; fi; echo "Waiting for web server to start on port 8888..."; sleep 5; counter=$[$counter +1]; done
  50. script:
  51. - cd /tmp/drupal
  52. - php ./scripts/run-tests.sh --verbose --color --php "$(which php)" --url http://127.0.0.1:8888 UUID | tee ~/tests.log
  53. - phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme sites/all/modules/uuid
  54. after_failure:
  55. # See what happened with the server.
  56. - cat ~/server.log