.travis.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. language: php
  2. sudo: false
  3. php:
  4. - 5.6
  5. - 7.0
  6. - 7.1
  7. - 7.2
  8. env:
  9. matrix:
  10. - DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test'
  11. global:
  12. - DEFAULT=1
  13. matrix:
  14. fast_finish: true
  15. include:
  16. - php: 7.1
  17. env: PHPCS=1 DEFAULT=0
  18. - php: 7.1
  19. env: CODECOVERAGE=1 DEFAULT=0
  20. - php: 7.1
  21. env: DB=pgsql db_dsn='postgres://postgres@127.0.0.1/cakephp_test'
  22. - php: 7.1
  23. env: DB=sqlite db_dsn='sqlite:///:memory:'
  24. - php: 5.6
  25. env: PREFER_LOWEST=1
  26. before_script:
  27. - if [[ $PREFER_LOWEST != 1 ]]; then composer install --prefer-source --no-interaction ; fi
  28. - if [[ $PREFER_LOWEST == 1 ]]; then composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable ; fi
  29. - if [[ $PHPCS != 1 ]]; then composer require phpunit/phpunit:"^5.7.14|^6.0"; fi
  30. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
  31. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
  32. - phpenv rehash
  33. - set +H
  34. - cp phpunit.xml.dist phpunit.xml
  35. script:
  36. - if [[ $DEFAULT == 1 ]]; then vendor/bin/phpunit; fi
  37. - if [[ $PHPCS == 1 ]]; then vendor/bin/phpcs -p --extensions=php --standard=vendor/fig-r/psr2r-sniffer/PSR2R/ruleset.xml --ignore=/tests/test_files/ src tests config ; fi
  38. - if [[ $CODECOVERAGE == 1 ]]; then vendor/bin/phpunit --coverage-clover=clover.xml || true; fi
  39. - if [[ $CODECOVERAGE == 1 ]]; then wget -O codecov.sh https://codecov.io/bash; fi
  40. - if [[ $CODECOVERAGE == 1 ]]; then bash codecov.sh; fi
  41. notifications:
  42. email: false