.travis.yml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. language: php
  2. services:
  3. - docker
  4. - postgresql
  5. sudo: required
  6. php:
  7. - 7.1
  8. - 7.2
  9. # PHP 7.3 is not yet supported (issue: https://www.drupal.org/project/drupal/issues/3012308)
  10. # - 7.3
  11. env:
  12. - BASE_URL="http://127.0.0.1:8080"
  13. install:
  14. - composer global require "drush/drush:~8"
  15. before_script:
  16. - docker pull statonlab/tripal2
  17. - psql -c "create database test_db encoding 'utf-8';" -U postgres
  18. - psql -c "alter role postgres with password 'dbpass';" -U postgres
  19. - cd ..
  20. # Set additional environment variables
  21. - export PATH="$HOME/.config/composer/vendor/bin:$PATH"
  22. - export DRUPAL_ROOT="$(pwd)/drupal"
  23. # Download and install Drupal
  24. - drush dl drupal-7 -y
  25. - mv drupal-7* drupal
  26. - cd drupal
  27. # Run the php server
  28. - php -S 127.0.0.1:8080 &
  29. - drush si -y --db-url='pgsql://postgres:dbpass@localhost:5432/test_db'
  30. --account-name='admin'
  31. --account-pass='admin_pass'
  32. --site-mail='admin@example.com'
  33. --site-name='Tripal 3'
  34. # Download Dependencies
  35. - drush dl -y field_group, field_group_table, field_formatter_class, field_formatter_settings, ctools, date, devel,
  36. ds, link, entity, libraries, redirect, token, uuid, jquery_update, views, webform
  37. # Enable dependencies
  38. - drush en -y field_group, field_group_table, field_formatter_class, field_formatter_settings, ctools, date, devel,
  39. ds, link, entity, libraries, redirect, token uuid, jquery_update, views, webform
  40. # up memory limit of PHP
  41. - echo "memory_limit=2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  42. script:
  43. # Link our repo to the modules directory
  44. - mv ../tripal sites/all/modules/tripal
  45. # Run a docker container with tripal 2 pre-installed
  46. - docker run -it -d --rm --name tripal2 -v "$(pwd)/sites/all/modules/tripal":/tripal statonlab/tripal2
  47. # Apply patches
  48. - wget --no-check-certificate https://drupal.org/files/drupal.pgsql-bytea.27.patch
  49. - patch -p1 < drupal.pgsql-bytea.27.patch
  50. - cd sites/all/modules/views
  51. - patch -p1 < ../tripal/tripal_chado_views/views-sql-compliant-three-tier-naming-1971160-30.patch
  52. - cd ../tripal
  53. # Install Tripal
  54. - drush en -y tripal tripal_chado tripal_chado_views tripal_ds tripal_ws
  55. - drush eval "module_load_include('inc', 'tripal_chado', 'includes/tripal_chado.install'); tripal_chado_load_drush_submit('Install Chado v1.3');"
  56. - drush trp-run-jobs --username=admin
  57. # Prepare Chado
  58. - drush eval "module_load_include('inc', 'tripal_chado', 'includes/setup/tripal_chado.setup'); tripal_chado_prepare_drush_submit();"
  59. - drush trp-run-jobs --username=admin
  60. # Run PHPUnit tests
  61. - composer update
  62. - cp tests/.travis.env tests/.env
  63. - ./vendor/bin/phpunit
  64. # Test Tripal v2 to v3 upgrade steps
  65. - docker exec -it tripal2 drush pm-disable tripal_core -y
  66. - docker exec -it tripal2 bash -c "rm -rf /modules/tripal && ln -s /tripal /modules/tripal"
  67. - docker exec -it tripal2 drush en -y tripal