.cache: &cache key: prefix: $RUBY_VERSION files: - Gemfile.lock - gitlab-qa.gemspec paths: - vendor/ruby include: - component: ${CI_SERVER_FQDN}/gitlab-org/components/danger-review/danger-review@1.4.0 inputs: job_image: "${CI_REGISTRY}/gitlab-org/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION}" job_stage: "check" - component: gitlab.com/gitlab-org/components/gem-release/gem-release@~latest stages: - check - test - qa - deploy default: image: ${CI_REGISTRY}/gitlab-org/gitlab-build-images/debian-${DEBIAN_VERSION}-ruby-${RUBY_VERSION} tags: - gitlab-org cache: <<: *cache policy: pull before_script: - bundle install workflow: rules: # For merge requests, create a pipeline. - if: '$CI_MERGE_REQUEST_IID' # For the default branch, create a pipeline (this includes on schedules, pushes, merges, etc.). - if: '$CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable$/' # For tags, create a pipeline. - if: '$CI_COMMIT_TAG' # When using Run pipeline button in the GitLab UI, from the project’s CI/CD > Pipelines section, create a pipeline. - if: '$CI_PIPELINE_SOURCE == "web"' variables: DEBIAN_VERSION: bookworm DOCKER_VERSION: "24.0.5" RUBY_VERSION: "3.1.5" BUNDLE_PATH: vendor BUNDLE_SILENCE_ROOT_WARNING: "true" BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES: "true" # Override rules to allow creating backport releases .release-base: rules: - if: '$CI_PIPELINE_SOURCE == "push" && ($CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH || $CI_COMMIT_REF_NAME =~ /^[\d-]+-stable$/)' changes: ["lib/**/version.rb"] package-and-test-env: image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine:latest stage: .pre variables: BUILD_ENV: build.env cache: [] before_script: [] script: - scripts/build-package-and-test-env artifacts: reports: dotenv: $BUILD_ENV rules: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' changes: - Gemfile.lock variables: UPDATE_QA_CACHE: "true" - if: '$CI_MERGE_REQUEST_IID' changes: - Gemfile.lock variables: UPDATE_QA_CACHE: "true" - when: always variables: UPDATE_QA_CACHE: "false" cache-gems: stage: .pre script: - echo "Cached gems!" cache: <<: *cache policy: pull-push when: on_success rules: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' changes: - Gemfile.lock - if: '$CI_MERGE_REQUEST_IID' changes: - Gemfile.lock danger-review: needs: - job: cache-gems optional: true rubocop: stage: check needs: - job: cache-gems optional: true script: - bundle exec rubocop --color rspec: stage: test needs: - job: cache-gems optional: true coverage: /LOC \((\d{1,3}\.\d{1,2})\%\)/ script: - bundle exec rspec --force-color artifacts: reports: coverage_report: coverage_format: cobertura path: coverage/coverage.xml package-and-test: stage: qa needs: - package-and-test-env variables: RELEASE: EE RUN_WITH_BUNDLE: "true" SKIP_OMNIBUS_TRIGGER: "true" SKIP_REPORT_IN_ISSUES: "true" UPDATE_QA_CACHE: $UPDATE_QA_CACHE GITLAB_QA_CACHE_KEY: $GITLAB_QA_CACHE_KEY QA_RETRY_FAILED_SPECS: "true" QA_RUN_TYPE: gitlab-qa QA_EXPORT_TEST_METRICS: "false" # skip metrics export as this pipeline is only used to validate gitlab-qa changes inherit: variables: - RUBY_VERSION - DEBIAN_VERSION - DOCKER_VERSION trigger: strategy: depend forward: yaml_variables: true pipeline_variables: true include: - project: gitlab-org/gitlab ref: master file: .gitlab/ci/test-on-omnibus/main.gitlab-ci.yml rules: - if: '$CI_MERGE_REQUEST_IID' when: manual allow_failure: true - when: always