performance.yml 1.8 KB

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