.gitlab-ci.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. - ls -al
  30. - php composer.phar --no-interaction install
  31. - php bin/phpunit --configuration phpunit.xml.dist --coverage-text --colors=never --no-interaction --do-not-cache-result
  32. artifacts:
  33. paths:
  34. - ./coverage/
  35. when: always
  36. reports:
  37. junit: ./coverage/junit-report.xml
  38. coverage: '/^\s*Lines:\s*\d+.\d+\%/'