performance.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. performance:
  2. stage: test
  3. rules:
  4. - if: $CI_PIPELINE_SOURCE == "schedule" || $CI_PIPELINE_SOURCE == "web"
  5. - if: $CI_PIPELINE_SOURCE == "merge_request_event"
  6. changes:
  7. - .gitlab/performance/**/*
  8. # Make sure this gets executed exclusively on a runner.
  9. tags: ['no_concurrency']
  10. services:
  11. - !reference [.services, postgresql]
  12. - !reference [.services, redis]
  13. cache: []
  14. before_script:
  15. # Copy performance checking code to tmp/ so that it survives branch switching
  16. - cp -rv .gitlab/performance tmp/
  17. # First, checkout stable and set it up.
  18. - git fetch --unshallow >/dev/null 2>&1
  19. - git checkout stable-6.0
  20. - !reference [.scripts, source_rvm]
  21. - rvm use 3.1.3
  22. - !reference [.scripts, bundle_install]
  23. - !reference [.scripts, configure_environment]
  24. - !reference [.scripts, zammad_db_init]
  25. - yarn install --silent # Required for assets:precompile test
  26. script:
  27. # Run performance tests for stable.
  28. - bundle exec rails r tmp/performance/run_tests.rb
  29. # Then, switch to the current commit, migrate to it and run a few selected tests.
  30. - git checkout $CI_COMMIT_SHA
  31. - rvm use 3.2.4
  32. - !reference [.scripts, bundle_install]
  33. # Force redis usage, even if it was disabled by the initial configure_environment script of stable.
  34. - export REDIS_URL=redis://redis
  35. - bundle exec rails db:migrate > /dev/null
  36. - rm -rf node_modules && pnpm install > /dev/null # Required for assets:precompile test
  37. # Run performance tests for current branch.
  38. - bundle exec rails r .gitlab/performance/run_tests.rb
  39. after_script: []