.travis.yml 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. - ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm
  18. # configure apache virtual hosts
  19. - sudo cp -f tests/travis-apache /etc/apache2/sites-available/default
  20. - sudo sed -e "s?%TRAVIS_BUILD_DIR%?$(pwd)?g" --in-place /etc/apache2/sites-available/default
  21. - sudo service apache2 restart
  22. # Install additional PHP packages (check http://docs.travis-ci.com/user/ci-environment/#CI-environment-OS
  23. # for pre-installed packages)
  24. #- sudo apt-get install -qq php5-imagick
  25. # Following http://docs.travis-ci.com/user/languages/php/#PHP-installation,
  26. # php is compiled with --enable-fpm, so no install of FPM is needed.
  27. # However, not installing it generates errors with service php5-fpm restart
  28. # further down (need to use php-fpm without 5)
  29. #- sudo apt-get install -qq php5-cli php5-fpm
  30. before_script:
  31. - php -d memory_limit=2G $(which composer) -v update
  32. # Previously, fxp/composer-asset-plugin was required but was causing a lot of trouble updating. Now it's disabled.
  33. #- composer global require "fxp/composer-asset-plugin:1.0.3"
  34. # You can either use the composer install method and face the Github limit
  35. #- composer install -n
  36. #- composer update
  37. # ...OR you can try the option --prefer-dist, that will reuse composer packages cache
  38. #- composer update --prefer-dist
  39. # ...OR you can try the --prefer-source option to download from source whenever it's possible (but it's much slower)
  40. #- composer update --prefer-source
  41. # ...OR use the proxy repository to download the necessary dependencies, but this repo is not always updated
  42. #- git clone -b 1.10.x --depth=1 https://github.com/ywarnier/chamilo-vendors.git
  43. #- sudo mv chamilo-vendors/vendor .
  44. #- sudo mv chamilo-vendors/web .
  45. #- sudo mv chamilo-vendors/composer.lock .
  46. #- sudo rm -rf chamilo-vendors
  47. # Continue...
  48. - phpenv config-add tests/travis-php-config.ini
  49. # enable php-fpm
  50. # configure apache virtual hosts
  51. - php -v
  52. # install Chash, a database, and then install Chamilo
  53. - git clone https://github.com/chamilo/chash
  54. - cd chash
  55. - composer install
  56. - composer update
  57. - php -d phar.readonly=0 createPhar.php
  58. - chmod +x chash.phar
  59. - sudo mv chash.phar /usr/local/bin/chash
  60. #- cd ..
  61. #- git clone -b nophpversioncheck --single-branch https://github.com/ywarnier/chamilo-cli-install.git
  62. #- cp chamilo-cli-install/chamilo-cli-installer.php main/install/
  63. #- mysql -u root -e 'create database chamilo'
  64. #- sudo chmod -R 0777 app/config app main/default_course_document/images main/lang
  65. #- cd main/install/
  66. #- 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'
  67. #- cd ../..
  68. # install Chamilo with Chash - see reference https://github.com/sonnym/travis-ci-drupal-module-example/blob/master/.travis.yml
  69. - cd /home/travis/build/chamilo/chamilo-lms
  70. # 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.
  71. # This effectively breaks the installer and renders these tests useless. We are looking for a solution (for example using containers)
  72. - 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="mysqlnd" --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
  73. script:
  74. # - phpunit -c tests/phpunit
  75. # pwd shows /home/travis/build/chamilo/chamilo-lms
  76. - cd tests && ../vendor/behat/behat/bin/behat -v
  77. # configure notifications (email, IRC, campfire etc)
  78. notifications:
  79. # IRC notifications - disabled for creating a lot of noise on the channel
  80. irc: "irc.freenode.org#chamilodev"