.travis.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. language: php
  2. sudo: false
  3. php:
  4. - 5.6
  5. - 7.0
  6. - 7.3
  7. env:
  8. matrix:
  9. - DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test'
  10. global:
  11. - DEFAULT=1
  12. matrix:
  13. fast_finish: true
  14. include:
  15. - php: 7.1
  16. env: DB=pgsql db_dsn='postgres://postgres@127.0.0.1/cakephp_test'
  17. - php: 7.2
  18. env: DB=sqlite db_dsn='sqlite:///:memory:'
  19. - php: 5.6
  20. env: PREFER_LOWEST=1
  21. - php: 7.2
  22. env: CHECKS=1 DEFAULT=0
  23. - php: 7.2
  24. env: CODECOVERAGE=1 DEFAULT=0
  25. before_script:
  26. - if [[ $PREFER_LOWEST != 1 ]]; then composer install --prefer-source --no-interaction ; fi
  27. - if [[ $PREFER_LOWEST == 1 ]]; then composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable ; fi
  28. - if [[ $CHECKS != 1 ]]; then composer require phpunit/phpunit:"^5.7.14|^6.0"; fi
  29. - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi"
  30. - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi"
  31. - phpenv rehash
  32. - set +H
  33. - cp phpunit.xml.dist phpunit.xml
  34. script:
  35. - if [[ $DEFAULT == 1 ]]; then vendor/bin/phpunit; fi
  36. - if [[ $CHECKS == 1 ]]; then composer phpstan-setup && composer phpstan ; fi
  37. - if [[ $CHECKS == 1 ]]; then composer cs-check ; 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