.travis.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. language: php
  2. sudo: false
  3. php:
  4. - 5.6
  5. - 7.3
  6. env:
  7. matrix:
  8. - DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test'
  9. global:
  10. - DEFAULT=1
  11. matrix:
  12. fast_finish: true
  13. include:
  14. - php: 7.0
  15. env: DB=pgsql db_dsn='postgres://postgres@127.0.0.1/cakephp_test'
  16. - php: 7.2
  17. env: DB=sqlite db_dsn='sqlite:///:memory:'
  18. - php: 5.6
  19. env: PREFER_LOWEST=1
  20. - php: 7.2
  21. env: CHECKS=1 DEFAULT=0
  22. - php: 7.2
  23. env: CODECOVERAGE=1 DEFAULT=0
  24. before_script:
  25. - phpenv config-rm xdebug.ini
  26. - if [[ $PREFER_LOWEST != 1 ]]; then composer install --prefer-source --no-interaction ; fi
  27. - if [[ $PREFER_LOWEST == 1 ]]; then composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction ; fi
  28. - if [[ $PREFER_LOWEST == 1 ]]; then composer require --dev dereuromark/composer-prefer-lowest; fi
  29. - if [[ $CHECKS != 1 ]]; then composer require --dev 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. script:
  33. - if [[ $DEFAULT == 1 ]]; then vendor/bin/phpunit; fi
  34. - if [[ $PREFER_LOWEST == 1 ]]; then vendor/bin/validate-prefer-lowest; fi
  35. - if [[ $CHECKS == 1 ]]; then composer phpstan-setup && composer phpstan ; fi
  36. - if [[ $CHECKS == 1 ]]; then composer cs-check ; fi
  37. - if [[ $CODECOVERAGE == 1 ]]; then vendor/bin/phpunit --coverage-clover=clover.xml || true; fi
  38. - if [[ $CODECOVERAGE == 1 ]]; then wget -O codecov.sh https://codecov.io/bash; fi
  39. - if [[ $CODECOVERAGE == 1 ]]; then bash codecov.sh; fi
  40. notifications:
  41. email: false