subscription.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # Run back-end subscription add-on tests to check if it is still compatible.
  2. addon:subscription:
  3. stage: test
  4. extends:
  5. - .job_rules_default
  6. rules:
  7. - if: $CI_COMMIT_REF_NAME == 'develop'
  8. when: on_success
  9. # Complain if breaking changes were merged and subscription is not ported.
  10. allow_failure: false
  11. - if: $CI_COMMIT_REF_NAME =~ /^(private|develop)/
  12. when: on_success
  13. # It could happen that in a branch we need to make breaking changes, so
  14. # only hint at the situation but don't block the pipeline.
  15. allow_failure: true
  16. - when: never
  17. services:
  18. - !reference [.services, postgresql]
  19. - !reference [.services, redis]
  20. - !reference [.services, memcached]
  21. variables:
  22. SUBSCRIPTION_CHECKOUT_DIR: $CI_PROJECT_DIR/../subscription
  23. script:
  24. - mkdir -p $SUBSCRIPTION_CHECKOUT_DIR
  25. - git clone --depth 1 https://gitlab-ci-token:$CI_JOB_TOKEN@git.zammad.com/zammad/subscription.git $SUBSCRIPTION_CHECKOUT_DIR
  26. - !reference [.scripts, zammad_db_init]
  27. - bundle exec rails runner "pp Package.link('${SUBSCRIPTION_CHECKOUT_DIR}')"
  28. - !reference [.scripts, bundle_install]
  29. - bundle exec rake zammad:package:migrate
  30. # Run actual subscription tests
  31. - (cd $SUBSCRIPTION_CHECKOUT_DIR/; find spec -type f -name "*.rb" | grep -v '/system/')
  32. - bundle exec rspec $(cd $SUBSCRIPTION_CHECKOUT_DIR/; find spec -type f -name "*.rb" | grep -v '/system/')
  33. - (cd $SUBSCRIPTION_CHECKOUT_DIR/; find test -type f -name "*.rb")
  34. - bundle exec ruby -Itest $(cd $SUBSCRIPTION_CHECKOUT_DIR/; find test -type f -name "*.rb")