.travis.yml 5.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. language: php
  2. php:
  3. #- 5.4 // Removed because of Chash dependencies on PHP 5.5
  4. - 5.5
  5. - 5.6
  6. - 7.0
  7. before_install:
  8. #- sudo apt-get install python-software-properties
  9. #- sudo add-apt-repository ppa:ondrej/php5 -y
  10. - sudo apt-get update -qq
  11. - sudo apt-get install -qq mysql-server
  12. - sudo apt-get install -qq apache2 libapache2-mod-fastcgi
  13. # enable php-fpm
  14. - sudo cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
  15. - sudo a2enmod rewrite actions fastcgi alias
  16. - echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  17. - echo "memory_limit = 2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  18. - echo "phar.readonly = 0" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  19. - echo "date.timezone = Europe/Paris" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
  20. - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
  21. # configure apache virtual hosts
  22. - sudo cp -f tests/travis-apache /etc/apache2/sites-available/default
  23. - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
  24. - sudo service apache2 restart
  25. # Install additional PHP packages (check http://docs.travis-ci.com/user/ci-environment/#CI-environment-OS
  26. # for pre-installed packages)
  27. #- sudo apt-get install -qq php5-imagick
  28. # Following http://docs.travis-ci.com/user/languages/php/#PHP-installation,
  29. # php is compiled with --enable-fpm, so no install of FPM is needed.
  30. # However, not installing it generates errors with service php5-fpm restart
  31. # further down (need to use php-fpm without 5)
  32. #- sudo apt-get install -qq php5-cli php5-fpm
  33. before_script:
  34. #- which composer
  35. #- php -d memory_limit=2G /usr/bin/composer update
  36. #- php -d memory_limit=2G /home/travis/.phpenv/shims/composer update
  37. # Previously, fxp/composer-asset-plugin was required but was causing a lot of trouble updating. Now it's disabled.
  38. #- composer global require "fxp/composer-asset-plugin:1.0.3"
  39. # You can either use the composer install method and face the Github limit
  40. #- composer install -n
  41. - composer update
  42. # ...OR you can try the option --prefer-dist, that will reuse composer packages cache
  43. #- composer update --prefer-dist
  44. # ...OR you can try the --prefer-source option to download from source whenever it's possible (but it's much slower)
  45. #- composer update --prefer-source
  46. # ...OR use the proxy repository to download the necessary dependencies, but this repo is not always updated
  47. #- git clone -b 1.10.x --depth=1 https://github.com/ywarnier/chamilo-vendors.git
  48. #- sudo mv chamilo-vendors/vendor .
  49. #- sudo mv chamilo-vendors/web .
  50. #- sudo mv chamilo-vendors/composer.lock .
  51. #- sudo rm -rf chamilo-vendors
  52. # Continue...
  53. - phpenv config-add tests/travis-php-config.ini
  54. # enable php-fpm
  55. # configure apache virtual hosts
  56. - php -v
  57. # install Chash, a database, and then install Chamilo
  58. - git clone https://github.com/chamilo/chash
  59. - cd chash
  60. - composer install
  61. - composer update
  62. - php -d phar.readonly=0 createPhar.php
  63. - chmod +x chash.phar
  64. - sudo mv chash.phar /usr/local/bin/chash
  65. #- cd ..
  66. #- git clone -b nophpversioncheck --single-branch https://github.com/ywarnier/chamilo-cli-install.git
  67. #- cp chamilo-cli-install/chamilo-cli-installer.php main/install/
  68. #- mysql -u root -e 'create database chamilo'
  69. #- sudo chmod -R 0777 app/config app main/default_course_document/images main/lang
  70. #- cd main/install/
  71. #- sudo php5 chamilo-cli-installer.php -l admin -p admin -U travis -u 'http://localhost/' -X travis -L english -z 'admin@example.com' -f 'John' -g 'Doe' -b '555-5555' -c 'Test campus' -y 'Chamilo' -x 'https://chamilo.org'
  72. #- cd ../..
  73. # install Chamilo with Chash - see reference https://github.com/sonnym/travis-ci-drupal-module-example/blob/master/.travis.yml
  74. - cd /home/travis/build/chamilo/chamilo-lms
  75. # There's an issue with Chash, starting in version 1.10, whereby PHP CLI on Travis-ci is PHP5.3, whatever the version you ask for.
  76. # This effectively breaks the installer and renders these tests useless. We are looking for a solution (for example using containers)
  77. - sudo chash chash:chamilo_install --no-interaction --sitename="Chamilo" --site_url="http://localhost/" --institution="Chamilo" --institution_url="https://chamilo.org" --encrypt_method="sha1" --firstname="John" --lastname="Doe" --language="english" --driver="pdo_mysql" --host="localhost" --port="3306" --dbname="chamilo" --dbuser="root" --permissions_for_new_directories="0777" --permissions_for_new_files="0666" --linux-user="www-data" --linux-group="www-data" --username="admin" --password="admin" --email="admin@example.com" --phone="555-5555" 1.10.x
  78. script:
  79. # - phpunit -c tests/phpunit
  80. # pwd shows /home/travis/build/chamilo/chamilo-lms
  81. - cd tests && ../vendor/behat/behat/bin/behat -v
  82. # configure notifications (email, IRC, campfire etc)
  83. notifications:
  84. # IRC notifications - disabled for creating a lot of noise on the channel
  85. irc: "irc.freenode.org#chamilodev"