.gitlab-ci.yml 875 B

12345678910111213141516171819202122232425262728293031323334
  1. stages:
  2. - build
  3. - test
  4. cache:
  5. paths:
  6. - ./ot_core/.Build/vendor
  7. build_image:
  8. stage: build
  9. image: docker:20.10
  10. before_script:
  11. - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
  12. script:
  13. - docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA .
  14. - docker tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA $CI_REGISTRY_IMAGE:latest
  15. - docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA
  16. - docker push $CI_REGISTRY_IMAGE:latest
  17. unit:otcore:
  18. image: $CI_REGISTRY_IMAGE:latest
  19. stage: test
  20. script:
  21. - composer --no-interaction --working-dir=./ot_core install
  22. - ./ot_core/.Build/bin/phpunit -c ./ot_core/Tests/Build/UnitTests.xml --coverage-text --colors=never
  23. artifacts:
  24. paths:
  25. - ./ot_core/coverage/
  26. when: always
  27. reports:
  28. junit: ./ot_core/coverage/junit-report.xml
  29. coverage: '/^\s*Lines:\s*\d+.\d+\%/'