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

Merge branch 'introduce-default-utils-ci-definition' into 'master'

ci: Introduce a new `.default-utils-before_script` CI definition

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/100388



Merged-by: default avatarLin Jen-Shin <jen-shin@gitlab.com>
Approved-by: default avatarLin Jen-Shin <jen-shin@gitlab.com>
Co-authored-by: default avatarRémy Coutable <remy@rymai.me>
No related branches found
No related tags found
无相关合并请求
...@@ -29,7 +29,7 @@ cache-workhorse: ...@@ -29,7 +29,7 @@ cache-workhorse:
variables: variables:
WEBPACK_REPORT: "false" WEBPACK_REPORT: "false"
script: script:
- !reference [.yarn-install, script] - yarn_install_script
- export GITLAB_ASSETS_HASH=$(bundle exec rake gitlab:assets:hash_sum) - export GITLAB_ASSETS_HASH=$(bundle exec rake gitlab:assets:hash_sum)
- source scripts/gitlab_component_helpers.sh - source scripts/gitlab_component_helpers.sh
- 'gitlab_assets_archive_doesnt_exist || { echoinfo "INFO: Exiting early as package exists."; exit 0; }' - 'gitlab_assets_archive_doesnt_exist || { echoinfo "INFO: Exiting early as package exists."; exit 0; }'
......
.yarn-install:
script:
- source scripts/utils.sh
- yarn_install_script
.storybook-yarn-install:
script:
- source scripts/utils.sh
- run_timed_command "retry yarn run storybook:install --frozen-lockfile"
.compile-assets-base: .compile-assets-base:
extends: extends:
- .default-retry - .default-retry
...@@ -98,20 +88,22 @@ update-assets-compile-test-cache: ...@@ -98,20 +88,22 @@ update-assets-compile-test-cache:
update-yarn-cache: update-yarn-cache:
extends: extends:
- .default-retry - .default-retry
- .default-utils-before_script
- .yarn-cache-push - .yarn-cache-push
- .shared:rules:update-cache - .shared:rules:update-cache
stage: prepare stage: prepare
script: script:
- !reference [.yarn-install, script] - yarn_install_script
update-storybook-yarn-cache: update-storybook-yarn-cache:
extends: extends:
- .default-retry - .default-retry
- .default-utils-before_script
- .storybook-yarn-cache-push - .storybook-yarn-cache-push
- .shared:rules:update-cache - .shared:rules:update-cache
stage: prepare stage: prepare
script: script:
- !reference [.storybook-yarn-install, script] - yarn_install_script
.frontend-fixtures-base: .frontend-fixtures-base:
extends: extends:
...@@ -194,7 +186,7 @@ graphql-schema-dump as-if-foss: ...@@ -194,7 +186,7 @@ graphql-schema-dump as-if-foss:
SETUP_DB: "false" SETUP_DB: "false"
before_script: before_script:
- !reference [.default-before_script, before_script] - !reference [.default-before_script, before_script]
- !reference [.yarn-install, script] - yarn_install_script
stage: test stage: test
.jest-base: .jest-base:
...@@ -261,6 +253,7 @@ jest-integration: ...@@ -261,6 +253,7 @@ jest-integration:
coverage-frontend: coverage-frontend:
extends: extends:
- .default-retry - .default-retry
- .default-utils-before_script
- .yarn-cache - .yarn-cache
- .frontend:rules:coverage-frontend - .frontend:rules:coverage-frontend
needs: needs:
...@@ -269,9 +262,8 @@ coverage-frontend: ...@@ -269,9 +262,8 @@ coverage-frontend:
- job: "jest minimal" - job: "jest minimal"
optional: true optional: true
stage: post-test stage: post-test
before_script:
- !reference [.yarn-install, script]
script: script:
- yarn_install_script
- run_timed_command "yarn node scripts/frontend/merge_coverage_frontend.js" - run_timed_command "yarn node scripts/frontend/merge_coverage_frontend.js"
# Removing the individual coverage results, as we just merged them. # Removing the individual coverage results, as we just merged them.
- if ls coverage-frontend/jest-* > /dev/null 2>&1; then - if ls coverage-frontend/jest-* > /dev/null 2>&1; then
...@@ -291,12 +283,13 @@ coverage-frontend: ...@@ -291,12 +283,13 @@ coverage-frontend:
.qa-frontend-node: .qa-frontend-node:
extends: extends:
- .default-retry - .default-retry
- .default-utils-before_script
- .qa-frontend-node-cache - .qa-frontend-node-cache
- .frontend:rules:qa-frontend-node - .frontend:rules:qa-frontend-node
stage: test stage: test
needs: [] needs: []
script: script:
- !reference [.yarn-install, script] - yarn_install_script
- run_timed_command "retry yarn run webpack-prod" - run_timed_command "retry yarn run webpack-prod"
qa-frontend-node:14: qa-frontend-node:14:
...@@ -316,6 +309,7 @@ qa-frontend-node:latest: ...@@ -316,6 +309,7 @@ qa-frontend-node:latest:
webpack-dev-server: webpack-dev-server:
extends: extends:
- .default-retry - .default-retry
- .default-utils-before_script
- .yarn-cache - .yarn-cache
- .frontend:rules:default-frontend-jobs - .frontend:rules:default-frontend-jobs
stage: test stage: test
...@@ -324,7 +318,7 @@ webpack-dev-server: ...@@ -324,7 +318,7 @@ webpack-dev-server:
WEBPACK_MEMORY_TEST: "true" WEBPACK_MEMORY_TEST: "true"
WEBPACK_VENDOR_DLL: "true" WEBPACK_VENDOR_DLL: "true"
script: script:
- !reference [.yarn-install, script] - yarn_install_script
- run_timed_command "retry yarn webpack-vendor" - run_timed_command "retry yarn webpack-vendor"
- run_timed_command "node --expose-gc node_modules/.bin/webpack-dev-server --config config/webpack.config.js" - run_timed_command "node --expose-gc node_modules/.bin/webpack-dev-server --config config/webpack.config.js"
artifacts: artifacts:
...@@ -336,13 +330,14 @@ webpack-dev-server: ...@@ -336,13 +330,14 @@ webpack-dev-server:
bundle-size-review: bundle-size-review:
extends: extends:
- .default-retry - .default-retry
- .default-utils-before_script
- .assets-compile-cache - .assets-compile-cache
- .frontend:rules:bundle-size-review - .frontend:rules:bundle-size-review
image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:danger image: ${REGISTRY_HOST}/${REGISTRY_GROUP}/gitlab-build-images:danger
stage: test stage: test
needs: [] needs: []
script: script:
- !reference [.yarn-install, script] - yarn_install_script
- scripts/bundle_size_review - scripts/bundle_size_review
artifacts: artifacts:
when: always when: always
...@@ -380,8 +375,8 @@ startup-css-check as-if-foss: ...@@ -380,8 +375,8 @@ startup-css-check as-if-foss:
- .frontend-test-base - .frontend-test-base
- .storybook-yarn-cache - .storybook-yarn-cache
script: script:
- !reference [.storybook-yarn-install, script] - run_timed_command "retry yarn run storybook:install --frozen-lockfile"
- yarn run storybook:build - run_timed_command "yarn run storybook:build"
needs: ["graphql-schema-dump"] needs: ["graphql-schema-dump"]
compile-storybook: compile-storybook:
......
...@@ -8,13 +8,17 @@ ...@@ -8,13 +8,17 @@
- job_execution_timeout - job_execution_timeout
- stuck_or_timeout_failure - stuck_or_timeout_failure
.default-before_script: .default-utils-before_script:
before_script: before_script:
- echo $FOSS_ONLY - echo $FOSS_ONLY
- '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb' - '[ "$FOSS_ONLY" = "1" ] && rm -rf ee/ qa/spec/ee/ qa/qa/specs/features/ee/ qa/qa/ee/ qa/qa/ee.rb'
- export GOPATH=$CI_PROJECT_DIR/.go - export GOPATH=$CI_PROJECT_DIR/.go
- mkdir -p $GOPATH - mkdir -p $GOPATH
- source scripts/utils.sh - source scripts/utils.sh
.default-before_script:
before_script:
- !reference [.default-utils-before_script, before_script]
- source scripts/prepare_build.sh - source scripts/prepare_build.sh
.ruby-gems-cache: &ruby-gems-cache .ruby-gems-cache: &ruby-gems-cache
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册