.gitlab-ci.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. stages:
  2. - test
  3. variables:
  4. APP_ENV: ci
  5. SSH_PRIVATE_KEY: $SSH_PRIVATE_KEY
  6. before_script:
  7. - apt-get -yqq update
  8. - apt-get -yqq install zip unzip git openssh-client
  9. # Run ssh-agent and add private key
  10. - eval $(ssh-agent -s)
  11. - mkdir -p ~/.ssh
  12. - chmod 700 ~/.ssh
  13. - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
  14. - ssh-add <(echo "$SSH_PRIVATE_KEY")
  15. - git config --global user.email "exploitation@opentalent.fr"
  16. - git config --global user.name "git"
  17. # install composer
  18. - curl -sS https://composer.github.io/installer.sig > installer.sig
  19. - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
  20. - php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
  21. - php composer-setup.php
  22. - php -r "unlink('composer-setup.php'); unlink('installer.sig');"
  23. cache:
  24. paths:
  25. - ./vendor
  26. unit:
  27. stage: test
  28. script:
  29. - php composer.phar --no-interaction --quiet install
  30. - php bin/phpunit --configuration phpunit.xml.dist --colors=never --no-interaction
  31. artifacts:
  32. paths:
  33. - ./coverage/
  34. when: always
  35. reports:
  36. junit: ./coverage/junit-report.xml
  37. coverage: '/^\s*Lines:\s*\d+.\d+\%/'