Hubzilla core code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

187 lines
5.4 KiB

  1. #
  2. # Travis-CI configuration file for Hubzilla
  3. #
  4. ## configure things
  5. #
  6. # see http://about.travis-ci.org/docs/user/languages/php/ for more hints
  7. language: php
  8. # use newer 'trusty' based distro, old one is 'precise'
  9. dist: trusty
  10. # use docker based containers
  11. sudo: false
  12. # Git branches whitelist to build on Travis CI
  13. branches:
  14. only:
  15. - master
  16. - dev
  17. # whitelist our tags for release deployments e.g. 2.2
  18. - /^\d+\.\d+(\.\d+)?(-\S*)?$/
  19. # Install additional software
  20. addons:
  21. # Install dependencies for generating API documentation with doxygen
  22. apt:
  23. packages:
  24. - doxygen
  25. - doxygen-latex
  26. - graphviz
  27. - ttf-liberation
  28. # enable and start databases on a per job basis
  29. #services:
  30. # - mariadb
  31. # - postgresql
  32. # any PHP version we want to test against, current stable phpunit requires PHP >= 7.0
  33. php:
  34. - '7.0'
  35. - '7.1'
  36. - '7.2'
  37. # HHVM does not fulfil PHPUnit platform requirements as being compatible with PHP7 yet
  38. #- 'hhvm'
  39. # list of environments to test
  40. env:
  41. global:
  42. # used for doxygen deployment script
  43. - DOXYFILE: $TRAVIS_BUILD_DIR/util/Doxyfile
  44. # Uncomment if a newer/specific version of Doxygen should be used
  45. #- DOXY_VER: 1.8.12
  46. # Code Coverage is slow, no need to have it in every build
  47. - PHPUCOV: "--no-coverage"
  48. # use matrix only for PHP and MySQL, all other combinations added through includes
  49. matrix:
  50. # trusty default MySQL 5.6
  51. - DB=mysql MYSQL_VERSION=5.6
  52. # Matrix configuration details
  53. matrix:
  54. fast_finish: true
  55. # Additional check combinations
  56. include:
  57. # PHP7.2, mariadb 10.2
  58. - php: '7.2'
  59. env: DB=mariadb MARIADB_VERSION=10.2 CODECOV=1
  60. # use mariadb instead of MySQL
  61. addons:
  62. mariadb: '10.2'
  63. # PHP7.2, PostgreSQL 9.6
  64. - php: '7.2'
  65. env: DB=pgsql POSTGRESQL_VERSION=9.6 PHPUNITFILE=phpunit-pgsql.xml
  66. # Use newer postgres than 9.2 default
  67. addons:
  68. postgresql: '9.6'
  69. services:
  70. - postgresql
  71. # PostgreSQL 10 with Docker container
  72. - php: '7.2'
  73. env: DB=pgsql POSTGRESQL_VERSION=10 PHPUNITFILE=phpunit-pgsql.xml
  74. sudo: required
  75. services:
  76. - docker
  77. # PHP7.2, old precise distribution with MySQL 5.5
  78. - php: '7.2'
  79. env: DB=mysql MYSQL_VERSION=5.5
  80. dist: precise
  81. services:
  82. - mysql
  83. # MySQL 5.7 with Docker container
  84. - php: '7.2'
  85. env: DB=mysql MYSQL_VERSION=5.7
  86. sudo: required
  87. services:
  88. - docker
  89. # Excludes from default matrix combinations
  90. # exclude:
  91. # - php: hhvm
  92. # env: DB=pgsql # PDO driver for pgsql is unsupported by HHVM (3rd party install for support)
  93. # cache composer downloads between runs
  94. cache:
  95. directories:
  96. - $HOME/.composer/cache
  97. #- $HOME/doxygen/doxygen-$DOXY_VER/bin
  98. #
  99. ## execute things
  100. #
  101. before_install:
  102. - travis_retry composer self-update
  103. # Start MySQL 5.7 Docker container, needs some time to come up
  104. - if [[ "$MYSQL_VERSION" == "5.7" ]]; then sudo service mysql stop; docker run -d -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=yes mysql:5.7 && sleep 25 && docker ps; fi
  105. # Start PostgreSQL 10 Docker container, needs some time to come up
  106. - if [[ "$POSTGRESQL_VERSION" == "10" ]]; then sudo service postgresql stop; docker run -d -p 5432:5432 postgres:10-alpine && sleep 35 && docker ps; fi
  107. # Install composer dev libs
  108. install:
  109. - travis_retry composer install --optimize-autoloader --no-progress
  110. # execute any number of scripts before the test run, custom env's are available as variables
  111. before_script:
  112. # Use code coverage config for phpunit
  113. - if [[ ! -z $CODECOV ]]; then export PHPUCOV=""; fi
  114. # Some preparation tasks of environment
  115. - ./tests/travis/prepare.sh
  116. # DB specific prepare scripts
  117. - if [[ "$DB" == "mysql" ]]; then ./tests/travis/prepare_mysql.sh; fi
  118. - if [[ "$DB" == "mariadb" ]]; then ./tests/travis/prepare_mysql.sh; fi
  119. - if [[ "$DB" == "pgsql" ]]; then ./tests/travis/prepare_pgsql.sh; fi
  120. # omitting "script:" will default to phpunit
  121. script:
  122. - ./vendor/bin/phpunit $PHPUCOV -c tests/$PHPUNITFILE
  123. after_success:
  124. - cat tests/results/testdox.txt
  125. # Generate API documentation and prepare for deployment
  126. - ./tests/travis/gen_apidocs.sh
  127. after_failure:
  128. - cat tests/results/testdox.txt
  129. # Deploying release and API documentation to GitHub
  130. before_deploy:
  131. - if [[ "$CODECOV" == "1" ]]; then zip -9 -r -q tests/hubzilla-testresults.zip tests/results; fi
  132. deploy:
  133. - provider: pages
  134. skip_cleanup: true
  135. local_dir: $TRAVIS_BUILD_DIR/doc/html
  136. github_token: $GH_TOKEN
  137. on:
  138. repo: redmatrix/hubzilla
  139. branch: master
  140. condition: '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")'
  141. # add API documentation to release, could also be used to provide full packages if we want to drop vendor from our repo
  142. - provider: releases
  143. skip_cleanup: true
  144. api_key: $GH_TOKEN
  145. file: 'doc/hubzilla-api-documentation.zip'
  146. on:
  147. repo: redmatrix/hubzilla
  148. tags: true
  149. condition: '(-n "$GH_TOKEN") && ("$TRAVIS_JOB_NUMBER" == "${TRAVIS_BUILD_NUMBER}.1")'
  150. # add code coverage and test results to release
  151. - provider: releases
  152. skip_cleanup: true
  153. api_key: $GH_TOKEN
  154. file: 'tests/hubzilla-testresults.zip'
  155. on:
  156. repo: redmatrix/hubzilla
  157. tags: true
  158. condition: '(-n "$GH_TOKEN") && ("$CODECOV" == "1")'
  159. #after_deploy:
  160. #after_script:
  161. # configure notifications (email, IRC, campfire etc)
  162. #notifications:
  163. # irc: "irc.freenode.org#yourfavouriteroomfortravis"
  164. # a plugin/script to post to a hubzilla channel would be neat here