.travis.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. language: php
  2. php:
  3. - 7.2
  4. - 7.4
  5. env:
  6. matrix:
  7. - DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test'
  8. global:
  9. - DEFAULT=1
  10. services:
  11. - postgresql
  12. - mysql
  13. matrix:
  14. fast_finish: true
  15. include:
  16. - php: 7.3
  17. env: DB=pgsql db_dsn='postgres://postgres@127.0.0.1/cakephp_test'
  18. - php: 7.3
  19. env: DB=sqlite db_dsn='sqlite:///:memory:'
  20. - php: 7.2
  21. env: PREFER_LOWEST=1
  22. - php: 7.3
  23. env: CHECKS=1 DEFAULT=0
  24. - php: 7.3
  25. env: CODECOVERAGE=1 DEFAULT=0
  26. before_install:
  27. - phpenv config-rm xdebug.ini
  28. before_script:
  29. - if [[ $PREFER_LOWEST != 1 ]]; then composer install --prefer-source --no-interaction ; fi
  30. - if [[ $PREFER_LOWEST == 1 ]]; then composer update --prefer-lowest --prefer-stable --prefer-dist --no-interaction ; fi
  31. - if [[ $PREFER_LOWEST == 1 ]]; then composer require --dev dereuromark/composer-prefer-lowest; fi
  32. - if [[ $CHECKS != 1 ]]; then composer require --dev phpunit/phpunit:"^8.4"; fi
  33. - if [[ $DB == 'mysql' ]]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi
  34. - if [[ $DB == 'pgsql' ]]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
  35. script:
  36. - if [[ $DEFAULT == 1 ]]; then vendor/bin/phpunit; fi
  37. - if [[ $PREFER_LOWEST == 1 ]]; then vendor/bin/validate-prefer-lowest; fi
  38. - if [[ $CODECOVERAGE == 1 ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml; fi
  39. - if [[ $CHECKS == 1 ]]; then composer stan-setup && composer stan ; fi
  40. - if [[ $CHECKS == 1 ]]; then composer cs-check ; fi
  41. after_success:
  42. - if [[ $CODECOVERAGE == 1 ]]; then bash <(curl -s https://codecov.io/bash); fi
  43. cache:
  44. directories:
  45. - $HOME/.composer/cache