From 9f466b66d0faab77c6c44eef160cc44807f685a2 Mon Sep 17 00:00:00 2001 From: catch Date: Thu, 2 Nov 2023 22:49:46 +0000 Subject: [PATCH] Issue #3398321 by bbrala, catch: Optimize GitLab resource requests phase 1 (cherry picked from commit e6d787eb17468273be3d6fa69b2e2f0998fada76) --- .gitlab-ci.yml | 26 +++++++++++++++++++++++--- .gitlab-ci/pipeline.yml | 6 ++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0892fa26d02..5a04137b214 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,6 +49,9 @@ variables: GIT_DEPTH: "3" PARENT_PIPELINE_ID: $CI_PIPELINE_ID +.default-lint-variables: &default-lint-variables + _TARGET_PHP: "8.2" + _TARGET_DB: "sqlite-3" ############# # Stages # @@ -73,9 +76,6 @@ stages: - stuck_or_timeout_failure - runner_system_failure - scheduler_failure - variables: - _TARGET_PHP: "8.2" - _TARGET_DB: "sqlite-3" image: name: $_CONFIG_DOCKERHUB_ROOT/php-$_TARGET_PHP-apache:production rules: @@ -224,6 +224,9 @@ stages: '๐Ÿ“ฆ๏ธ Composer': <<: *default-job-settings-lint + variables: + <<: *default-lint-variables + KUBERNETES_CPU_REQUEST: "1" stage: ๐Ÿ—๏ธ Build cache: key: @@ -243,6 +246,9 @@ stages: '๐Ÿ“ฆ๏ธ Yarn': <<: *default-job-settings-lint + variables: + <<: *default-lint-variables + KUBERNETES_CPU_REQUEST: "2" stage: ๐Ÿ—๏ธ Build cache: key: @@ -266,6 +272,9 @@ stages: '๐Ÿงน PHP Static Analysis (phpstan)': <<: [ *with-composer, *junit-artifacts, *default-job-settings-lint ] stage: ๐Ÿช„ Lint + variables: + <<: *default-lint-variables + KUBERNETES_CPU_REQUEST: "16" script: - php vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --error-format=gitlab > phpstan-quality-report.json artifacts: @@ -275,6 +284,9 @@ stages: '๐Ÿงน PHP Coding standards (PHPCS)': <<: [ *with-composer, *junit-artifacts, *default-job-settings-lint ] stage: ๐Ÿช„ Lint + variables: + <<: *default-lint-variables + KUBERNETES_CPU_REQUEST: "16" script: - composer phpcs -- --report-full --report-summary --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-quality-report.json artifacts: @@ -284,6 +296,8 @@ stages: '๐Ÿงน JavaScript linting (eslint)': <<: [ *with-yarn, *junit-artifacts, *default-job-settings-lint ] stage: ๐Ÿช„ Lint + variables: + KUBERNETES_CPU_REQUEST: "2" script: - yarn --cwd=./core run -s lint:core-js-passing --format gitlab artifacts: @@ -293,6 +307,8 @@ stages: '๐Ÿงน CSS linting (stylelint)': <<: [ *with-yarn, *junit-artifacts, *default-job-settings-lint ] stage: ๐Ÿช„ Lint + variables: + KUBERNETES_CPU_REQUEST: "2" script: - yarn run --cwd=./core lint:css --color --custom-formatter=node_modules/stylelint-formatter-gitlab artifacts: @@ -302,6 +318,8 @@ stages: '๐Ÿงน Compilation check': <<: [ *with-yarn, *default-job-settings-lint ] stage: ๐Ÿช„ Lint + variables: + KUBERNETES_CPU_REQUEST: "2" script: - yarn run --cwd=./core build:css --check - cd core && yarn run -s check:ckeditor5 @@ -309,6 +327,8 @@ stages: '๐Ÿ“” Spell-checking': <<: [ *with-yarn, *default-job-settings-lint ] stage: ๐Ÿช„ Lint + variables: + KUBERNETES_CPU_REQUEST: "2" script: - export TARGET_BRANCH=${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}${CI_COMMIT_BRANCH} - git fetch -vn --depth=$GIT_DEPTH "${CI_MERGE_REQUEST_PROJECT_URL:-origin}" "+refs/heads/$TARGET_BRANCH:refs/heads/$TARGET_BRANCH" diff --git a/.gitlab-ci/pipeline.yml b/.gitlab-ci/pipeline.yml index a625b42a3ba..a38c9d0a889 100644 --- a/.gitlab-ci/pipeline.yml +++ b/.gitlab-ci/pipeline.yml @@ -141,6 +141,7 @@ stages: <<: *test-variables TESTSUITE: PHPUnit-Functional CONCURRENCY: "$CONCURRENCY" + KUBERNETES_CPU_REQUEST: "24" services: - <<: *with-database @@ -190,6 +191,7 @@ stages: <<: *test-variables TESTSUITE: PHPUnit-Kernel CONCURRENCY: "$CONCURRENCY" + KUBERNETES_CPU_REQUEST: "16" services: - <<: *with-database @@ -200,6 +202,7 @@ stages: <<: *test-variables TESTSUITE: PHPUnit-FunctionalJavascript CONCURRENCY: 15 + KUBERNETES_CPU_REQUEST: "8" services: - <<: *with-database - <<: *with-chrome @@ -210,6 +213,7 @@ stages: <<: *test-variables TESTSUITE: PHPUnit-Build CONCURRENCY: "$CONCURRENCY" + KUBERNETES_CPU_REQUEST: "2" services: - <<: *with-database @@ -223,11 +227,13 @@ stages: <<: *test-variables TESTSUITE: PHPUnit-Unit CONCURRENCY: "$CONCURRENCY" + KUBERNETES_CPU_REQUEST: "16" '๐Ÿฆ‰๏ธ๏ธ๏ธ Nightwatch': <<: [ *with-composer-and-yarn, *setup-webserver, *default-job-settings ] variables: <<: *test-variables + KUBERNETES_CPU_REQUEST: "3" services: - <<: *with-database - <<: *with-chrome