.travis.yml 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. # Travis CI build configuration for MediaWiki
  2. # <https://travis-ci.org/wikimedia/mediawiki-core>
  3. #
  4. # The Wikimedia Foundation uses a self-hosted Jenkins instance to run unit
  5. # tests, but it tests code against the version of PHP that is deployed on
  6. # Wikimedia's production cluster. This Travis CI configuration is designed to
  7. # complement that setup by testing MediaWiki on travis
  8. #
  9. language: php
  10. # Use fast containers instead of the slower sudo-enabled VMs:
  11. sudo: false
  12. # Use Ubuntu 14 Trusty (not Ubuntu 12 Precise)
  13. # <https://docs.travis-ci.com/user/reference/trusty/>
  14. # - Required in order to use HHVM 3.6 or higher.
  15. # - Required for non-buggy xml library for XmlTypeCheck/UploadBaseTest (T75176).
  16. dist: trusty
  17. matrix:
  18. fast_finish: true
  19. include:
  20. # On Trusty, mysql user 'travis' doesn't have create database rights
  21. # Postgres has no user called 'root'.
  22. - env: dbtype=mysql dbuser=root
  23. php: 7.2
  24. - env: dbtype=mysql dbuser=root
  25. php: 7.1
  26. - env: dbtype=postgres dbuser=travis
  27. php: 7.1
  28. - env: dbtype=mysql dbuser=root
  29. php: 7
  30. # https://docs.travis-ci.com/user/languages/php#HHVM-versions
  31. - env: dbtype=mysql dbuser=root
  32. php: hhvm-3.24
  33. - env: dbtype=mysql dbuser=root
  34. php: hhvm-3.21
  35. - env: dbtype=mysql dbuser=root
  36. php: hhvm-3.18
  37. allow_failures:
  38. - php: 7.2
  39. - php: hhvm-3.18
  40. - php: hhvm-3.21
  41. - php: hhvm-3.24
  42. services:
  43. - mysql
  44. branches:
  45. # Test changes in master and arbitrary Travis CI branches only.
  46. # The latter allows developers to enable Travis CI in their GitHub fork of
  47. # wikimedia/mediawiki and then push changes for testing to branches like
  48. # "travis-ci/test-this-awesome-change".
  49. only:
  50. - master
  51. - /^travis-ci\/.*$/
  52. addons:
  53. apt:
  54. packages:
  55. - djvulibre-bin
  56. - tidy
  57. before_script:
  58. - composer install --prefer-source --quiet --no-interaction
  59. - if [ "$dbtype" = postgres ]; then psql -c "CREATE DATABASE traviswiki WITH OWNER travis;" -U postgres; fi
  60. - >
  61. php maintenance/install.php traviswiki admin
  62. --pass travis
  63. --dbtype "$dbtype"
  64. --dbname traviswiki
  65. --dbuser "$dbuser"
  66. --dbpass ""
  67. --scriptpath "/w"
  68. - echo -en "\n\nrequire_once __DIR__ . '/includes/DevelopmentSettings.php';\n" >> ./LocalSettings.php
  69. - php -l ./LocalSettings.php
  70. script:
  71. - php tests/phpunit/phpunit.php
  72. notifications:
  73. email: false
  74. irc:
  75. channels:
  76. - "chat.freenode.net#wikimedia-dev"
  77. template:
  78. - "%{repository}#%{build_number} (%{branch} - %{commit} %{author}): %{message} - %{build_url}"
  79. on_success: change
  80. on_failure: always