.gitlab-ci.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. stages:
  2. - test
  3. variables:
  4. APP_ENV: staging
  5. SSH_PRIVATE_KEY: $SSH_PRIVATE_KEY
  6. XDEBUG_MODE: coverage
  7. cache:
  8. paths:
  9. - ./vendor
  10. before_script:
  11. - bash tests/ci_docker_install.sh > /dev/null
  12. - php -v
  13. static_analysis:
  14. script:
  15. - php vendor/bin/phpstan analyse -c phpstan.neon.dist --error-format gitlab > phpstan.json # Display code quality in MR
  16. - php vendor/bin/phpstan analyse -c phpstan.neon.dist
  17. artifacts:
  18. when: always
  19. reports:
  20. codequality: phpstan.json
  21. code_style:
  22. script:
  23. - php vendor/bin/php-cs-fixer check --config=.php-cs-fixer.dist.php
  24. unit:
  25. stage: test
  26. script:
  27. - php vendor/phpunit/phpunit/phpunit --configuration phpunit.xml.dist --colors=never --no-interaction --testsuite=unit
  28. #- php vendor/phpunit/phpunit/phpunit --configuration phpunit.xml.dist --colors=never --no-interaction --no-coverage --testsuite=application
  29. artifacts:
  30. paths:
  31. - ./coverage/
  32. when: always
  33. reports:
  34. junit: ./coverage/junit-report.xml
  35. coverage: '/^\s*Lines:\s*\d+.\d+\%/'