Skip to content
代码片段 群组 项目
提交 dc790660 编辑于 作者: Lin Jen-Shin's avatar Lin Jen-Shin
浏览文件

Run various Ruby versions

* Default: 3.1
* Merge requests: Default (3.1)
* Default branch: Default (3.1)
* ruby3_0 branch: Old (3.0)
* ruby3_2 branch: Next (3.2)
* With labels: Use the respective versions
上级 2626ff46
No related branches found
No related tags found
无相关合并请求
...@@ -27,11 +27,20 @@ default: ...@@ -27,11 +27,20 @@ default:
# Default job timeout doesn't work: https://gitlab.com/gitlab-org/gitlab/-/issues/387528 # Default job timeout doesn't work: https://gitlab.com/gitlab-org/gitlab/-/issues/387528
timeout: 90m timeout: 90m
.old-ruby-variables: &old-ruby-variables
RUBY_VERSION: "3.0"
CACHE_EDITION: "GITLAB_RUBY3_0"
USE_OLD_RUBY_VERSION: "true"
.default-ruby-variables: &default-ruby-variables .default-ruby-variables: &default-ruby-variables
RUBY_VERSION: "3.1" RUBY_VERSION: "3.1"
CACHE_EDITION: "GITLAB_RUBY3_1"
USE_OLD_RUBY_VERSION: "true"
.next-ruby-variables: &next-ruby-variables .next-ruby-variables: &next-ruby-variables
RUBY_VERSION: "3.2" RUBY_VERSION: "3.2"
CACHE_EDITION: "GITLAB_RUBY3_2"
USE_OLD_RUBY_VERSION: "false"
.default-branch-pipeline-failure-variables: &default-branch-pipeline-failure-variables .default-branch-pipeline-failure-variables: &default-branch-pipeline-failure-variables
CREATE_RAILS_TEST_FAILURE_ISSUES: "true" CREATE_RAILS_TEST_FAILURE_ISSUES: "true"
...@@ -51,6 +60,7 @@ workflow: ...@@ -51,6 +60,7 @@ workflow:
rules: rules:
- if: '$CI_PROJECT_PATH == "gitlab-org/gitaly" && $CI_PIPELINE_SOURCE == "parent_pipeline" && $GITALY_TEST' - if: '$CI_PROJECT_PATH == "gitlab-org/gitaly" && $CI_PIPELINE_SOURCE == "parent_pipeline" && $GITALY_TEST'
variables: variables:
<<: *default-ruby-variables
PIPELINE_NAME: 'Gitaly Rails Test Pipeline' PIPELINE_NAME: 'Gitaly Rails Test Pipeline'
# If `$FORCE_GITLAB_CI` is set, create a pipeline. # If `$FORCE_GITLAB_CI` is set, create a pipeline.
- if: '$FORCE_GITLAB_CI' - if: '$FORCE_GITLAB_CI'
...@@ -64,26 +74,36 @@ workflow: ...@@ -64,26 +74,36 @@ workflow:
# they serve no purpose and will run anyway when the changes are merged. # they serve no purpose and will run anyway when the changes are merged.
- if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^release-tools\/\d+\.\d+\.\d+-rc\d+$/ && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^[\d-]+-stable(-ee)?$/ && $CI_PROJECT_PATH == "gitlab-org/gitlab"' - if: '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^release-tools\/\d+\.\d+\.\d+-rc\d+$/ && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^[\d-]+-stable(-ee)?$/ && $CI_PROJECT_PATH == "gitlab-org/gitlab"'
when: never when: never
# For merge requests running exclusively in Ruby 3.1 - if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3_0/'
variables:
<<: *old-ruby-variables
PIPELINE_NAME: 'Ruby $RUBY_VERSION $CI_MERGE_REQUEST_EVENT_TYPE MR pipeline'
NO_SOURCEMAPS: 'true'
- if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3_1/' - if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3_1/'
variables: variables:
<<: *default-ruby-variables <<: *default-ruby-variables
PIPELINE_NAME: 'Ruby $RUBY_VERSION $CI_MERGE_REQUEST_EVENT_TYPE MR pipeline' PIPELINE_NAME: 'Ruby $RUBY_VERSION $CI_MERGE_REQUEST_EVENT_TYPE MR pipeline'
NO_SOURCEMAPS: 'true' NO_SOURCEMAPS: 'true'
- if: '$CI_MERGE_REQUEST_LABELS =~ /Community contribution/' - if: '$CI_MERGE_REQUEST_LABELS =~ /pipeline:run-in-ruby3_2/'
variables: variables:
<<: *next-ruby-variables <<: *next-ruby-variables
PIPELINE_NAME: 'Ruby $RUBY_VERSION $CI_MERGE_REQUEST_EVENT_TYPE MR pipeline'
NO_SOURCEMAPS: 'true'
- if: '$CI_MERGE_REQUEST_LABELS =~ /Community contribution/'
variables:
<<: *default-ruby-variables
GITLAB_DEPENDENCY_PROXY_ADDRESS: "" GITLAB_DEPENDENCY_PROXY_ADDRESS: ""
PIPELINE_NAME: 'Ruby $RUBY_VERSION $CI_MERGE_REQUEST_EVENT_TYPE MR pipeline (community contribution)' PIPELINE_NAME: 'Ruby $RUBY_VERSION $CI_MERGE_REQUEST_EVENT_TYPE MR pipeline (community contribution)'
NO_SOURCEMAPS: 'true' NO_SOURCEMAPS: 'true'
- <<: *if-merge-request-security-canonical-sync - <<: *if-merge-request-security-canonical-sync
variables: variables:
<<: *default-ruby-variables
PIPELINE_NAME: '$CI_DEFAULT_BRANCH security->canonical sync' PIPELINE_NAME: '$CI_DEFAULT_BRANCH security->canonical sync'
SKIP_MESSAGE: 'MR only contains changes from the security mirror, which have already been reviewed, tested and deployed.' SKIP_MESSAGE: 'MR only contains changes from the security mirror, which have already been reviewed, tested and deployed.'
# For (detached) merge request pipelines. # For (detached) merge request pipelines.
- if: '$CI_MERGE_REQUEST_IID' - if: '$CI_MERGE_REQUEST_IID'
variables: variables:
<<: *next-ruby-variables <<: *default-ruby-variables
<<: *default-merge-request-slow-tests-variables <<: *default-merge-request-slow-tests-variables
PIPELINE_NAME: 'Ruby $RUBY_VERSION $CI_MERGE_REQUEST_EVENT_TYPE MR pipeline' PIPELINE_NAME: 'Ruby $RUBY_VERSION $CI_MERGE_REQUEST_EVENT_TYPE MR pipeline'
NO_SOURCEMAPS: 'true' NO_SOURCEMAPS: 'true'
...@@ -93,7 +113,10 @@ workflow: ...@@ -93,7 +113,10 @@ workflow:
<<: [*default-ruby-variables, *default-branch-pipeline-failure-variables] <<: [*default-ruby-variables, *default-branch-pipeline-failure-variables]
CRYSTALBALL: "true" CRYSTALBALL: "true"
PIPELINE_NAME: 'Scheduled Ruby $RUBY_VERSION $CI_COMMIT_BRANCH branch pipeline' PIPELINE_NAME: 'Scheduled Ruby $RUBY_VERSION $CI_COMMIT_BRANCH branch pipeline'
# Run pipelines for ruby3_2 branch - if: '$CI_COMMIT_BRANCH == "ruby3_0" && $CI_PIPELINE_SOURCE == "schedule"'
variables:
<<: *old-ruby-variables
PIPELINE_NAME: 'Scheduled Ruby $RUBY_VERSION $CI_COMMIT_BRANCH branch pipeline'
- if: '$CI_COMMIT_BRANCH == "ruby3_2" && $CI_PIPELINE_SOURCE == "schedule"' - if: '$CI_COMMIT_BRANCH == "ruby3_2" && $CI_PIPELINE_SOURCE == "schedule"'
variables: variables:
<<: *next-ruby-variables <<: *next-ruby-variables
......
...@@ -90,9 +90,9 @@ trigger-omnibus: ...@@ -90,9 +90,9 @@ trigger-omnibus:
TOP_UPSTREAM_SOURCE_PROJECT: $CI_PROJECT_PATH TOP_UPSTREAM_SOURCE_PROJECT: $CI_PROJECT_PATH
SECURITY_SOURCES: $SECURITY_SOURCES SECURITY_SOURCES: $SECURITY_SOURCES
CACHE_UPDATE: $OMNIBUS_GITLAB_CACHE_UPDATE CACHE_UPDATE: $OMNIBUS_GITLAB_CACHE_UPDATE
USE_OLD_RUBY_VERSION: "true" USE_OLD_RUBY_VERSION: $USE_OLD_RUBY_VERSION
CACHE_EDITION: "GITLAB_RUBY3_1" CACHE_EDITION: $CACHE_EDITION
NEXT_RUBY_VERSION: "3.2.2" NEXT_RUBY_VERSION: $FULL_RUBY_VERSION
BUILD_ON_ALL_OS: $OMNIBUS_GITLAB_BUILD_ON_ALL_OS BUILD_ON_ALL_OS: $OMNIBUS_GITLAB_BUILD_ON_ALL_OS
SKIP_QA_TEST: "true" SKIP_QA_TEST: "true"
ee: $EE ee: $EE
......
...@@ -1543,10 +1543,6 @@ ...@@ -1543,10 +1543,6 @@
- !reference [".qa:rules:package-and-test-never-run", rules] - !reference [".qa:rules:package-and-test-never-run", rules]
- <<: *if-merge-request-targeting-stable-branch - <<: *if-merge-request-targeting-stable-branch
changes: *setup-test-env-patterns changes: *setup-test-env-patterns
- <<: *if-ruby3_2-branch
variables:
USE_OLD_RUBY_VERSION: 'false'
CACHE_EDITION: 'GITLAB_RUBY3_2'
- <<: *if-merge-request - <<: *if-merge-request
changes: *dependency-patterns changes: *dependency-patterns
variables: variables:
...@@ -1589,9 +1585,6 @@ ...@@ -1589,9 +1585,6 @@
changes: *setup-test-env-patterns changes: *setup-test-env-patterns
allow_failure: true allow_failure: true
- <<: *if-ruby3_2-branch - <<: *if-ruby3_2-branch
variables:
USE_OLD_RUBY_VERSION: 'false'
CACHE_EDITION: 'GITLAB_RUBY3_2'
allow_failure: true allow_failure: true
- <<: *if-merge-request - <<: *if-merge-request
changes: *dependency-patterns changes: *dependency-patterns
...@@ -1640,9 +1633,6 @@ ...@@ -1640,9 +1633,6 @@
- <<: *if-merge-request-targeting-stable-branch - <<: *if-merge-request-targeting-stable-branch
changes: *setup-test-env-patterns changes: *setup-test-env-patterns
- <<: *if-ruby3_2-branch - <<: *if-ruby3_2-branch
variables:
USE_OLD_RUBY_VERSION: 'false'
CACHE_EDITION: 'GITLAB_RUBY3_2'
- <<: *if-merge-request - <<: *if-merge-request
# Certain components trigger a rebuild of the e2e GDK image so we want to test it too # Certain components trigger a rebuild of the e2e GDK image so we want to test it too
changes: *gdk-component-patterns changes: *gdk-component-patterns
...@@ -2797,6 +2787,7 @@ ...@@ -2797,6 +2787,7 @@
.setup:rules:verify-default-ruby: .setup:rules:verify-default-ruby:
rules: rules:
- <<: *if-merge-request-labels-run-in-ruby3_0
- <<: *if-merge-request-labels-run-in-ruby3_2 - <<: *if-merge-request-labels-run-in-ruby3_2
.setup:rules:verify-tests-yml: .setup:rules:verify-tests-yml:
......
...@@ -71,8 +71,7 @@ verify-default-ruby: ...@@ -71,8 +71,7 @@ verify-default-ruby:
- .setup:rules:verify-default-ruby - .setup:rules:verify-default-ruby
stage: prepare stage: prepare
script: script:
- echo 'Please remove label ~"pipeline:run-in-ruby3_2" so we do test against default Ruby version before merging the merge request' - echo 'Please remove label ~"pipeline:run-in-ruby3_2" or ~"pipeline:run-in-ruby3_0" so we do test against default Ruby version before merging the merge request'
- echo 'This does not work yet. See https://gitlab.com/gitlab-org/gitlab/-/issues/428537'
- exit 1 - exit 1
verify-tests-yml: verify-tests-yml:
...@@ -208,7 +207,7 @@ trigger-omnibus-env: ...@@ -208,7 +207,7 @@ trigger-omnibus-env:
for version_file in *_VERSION; do echo "$version_file=$(cat $version_file)" >> $BUILD_ENV; done for version_file in *_VERSION; do echo "$version_file=$(cat $version_file)" >> $BUILD_ENV; done
echo "OMNIBUS_GITLAB_BUILD_ON_ALL_OS=${OMNIBUS_GITLAB_BUILD_ON_ALL_OS:-false}" >> $BUILD_ENV echo "OMNIBUS_GITLAB_BUILD_ON_ALL_OS=${OMNIBUS_GITLAB_BUILD_ON_ALL_OS:-false}" >> $BUILD_ENV
echo "USE_OLD_RUBY_VERSION=${USE_OLD_RUBY_VERSION:-false}" >> $BUILD_ENV echo "USE_OLD_RUBY_VERSION=${USE_OLD_RUBY_VERSION:-false}" >> $BUILD_ENV
echo "NEXT_RUBY_VERSION=${NEXT_RUBY_VERSION}" >> $BUILD_ENV ruby -e 'puts "FULL_RUBY_VERSION=#{RUBY_VERSION}"' >> $BUILD_ENV
echo "GITLAB_ASSETS_TAG=$(assets_image_tag)" >> $BUILD_ENV echo "GITLAB_ASSETS_TAG=$(assets_image_tag)" >> $BUILD_ENV
echo "EE=$([[ $FOSS_ONLY == '1' ]] && echo 'false' || echo 'true')" >> $BUILD_ENV echo "EE=$([[ $FOSS_ONLY == '1' ]] && echo 'false' || echo 'true')" >> $BUILD_ENV
define_trigger_branch_in_build_env define_trigger_branch_in_build_env
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册