Skip to content
Snippets Groups Projects
Verified Commit 3c4f80ad authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3463479 by catch, Spokje, larowlan: Merge the build and lint stages in core MR pipelines

(cherry picked from commit 81d8971a)
parent 62a37e84
No related branches found
No related tags found
17 merge requests!10663Issue #3495778: Update phpdoc in FileSaveHtaccessLoggingTest,!10451Issue #3472458 by watergate, smustgrave: CKEditor 5 show blocks label is not translated,!103032838547 Fix punctuation rules for inline label suffix colon with CSS only,!10150Issue #3467294 by quietone, nod_, smustgrave, catch, longwave: Change string...,!10130Resolve #3480321 "Second level menu",!9936Issue #3483087: Check the module:// prefix in the translation server path and replace it with the actual module path,!9933Issue #3394728 by ankondrat4: Undefined array key "#prefix" and deprecated function: explode() in Drupal\file\Element\ManagedFile::uploadAjaxCallback(),!9914Issue #3451136 by quietone, gapple, ghost of drupal past: Improve...,!9882Draft: Issue #3481777 In bulk_form ensure the triggering element is the bulk_form button,!9839Issue #3445469 by pooja_sharma, smustgrave: Add additional test coverage for...,!9815Issue #3480025: There is no way to remove entity cache items,!9757Issue #3478869 Add "All" or overview links to parent links,!9752Issue #3439910 by pooja_sharma, vensires: Fix Toolbar tests that rely on UID1's super user behavior,!9749Issue #3439910 by pooja_sharma, vensires: Fix Toolbar tests that rely on UID1's super user behavior,!9678Issue #3465132 by catch, Spokje, nod_: Show test run time by class in run-tests.sh output,!9578Issue #3304746 by scott_euser, casey, smustgrave: BigPipe cannot handle (GET)...,!9449Issue #3344041: Allow textarea widgets to be used for text (formatted) fields
Pipeline #235457 passed
......@@ -69,7 +69,6 @@ variables:
# Stages #
#############
stages:
- 🏗️ Build
- 🪄 Lint
- 🗜️ Test
......@@ -96,11 +95,7 @@ default:
.with-composer: &with-composer
needs:
- '📦️ Composer'
.with-yarn: &with-yarn
needs:
- '📦️ Yarn'
- '🧹 PHP Coding standards (PHPCS)'
.default-job-settings-lint: &default-job-settings-lint
rules:
......@@ -240,65 +235,22 @@ default:
needs: [ '[Daily] PHP 8.3 SQLite 3.45' ]
<<: [ *run-daily ]
################
# Build Jobs for linting
################
'📦️ Composer':
variables:
KUBERNETES_CPU_REQUEST: "1"
stage: 🏗️ Build
cache:
key:
files:
- ./composer.json
- ./composer.lock
paths:
- ./vendor
artifacts:
expire_in: 1 week
expose_as: 'web-vendor'
paths:
- vendor/
script:
- composer validate
- composer install --optimize-autoloader
- if [ -n "$COMPOSER_UPDATE" ]; then
composer update --optimize-autoloader;
composer outdated;
fi
'📦️ Yarn':
variables:
KUBERNETES_CPU_REQUEST: "2"
stage: 🏗️ Build
cache:
key:
files:
- ./core/package.json
- ./core/yarn.lock
paths:
- ./core/node_modules
artifacts:
expire_in: 1 week
expose_as: 'yarn-vendor'
paths:
- core/node_modules/
script:
- cd core
- corepack enable
- yarn install
################
# Lint Jobs
################
'🧹 PHP Static Analysis (phpstan)':
<<: [ *with-composer, *default-job-settings-lint ]
<<: [ *default-job-settings-lint ]
stage: 🪄 Lint
variables:
KUBERNETES_CPU_REQUEST: "16"
script:
- composer validate
- composer install --optimize-autoloader
- if [ -n "$COMPOSER_UPDATE" ]; then
composer update --optimize-autoloader;
composer outdated;
fi
- vendor/bin/phpstan --version
# Rely on PHPStan caching to execute analysis multiple times without performance drawback.
# Output a copy in junit.
......@@ -324,19 +276,28 @@ default:
- core/.phpstan-baseline.php
'🧹 PHP Coding standards (PHPCS)':
<<: [ *with-composer, *default-job-settings-lint ]
<<: [ *default-job-settings-lint ]
stage: 🪄 Lint
variables:
KUBERNETES_CPU_REQUEST: "16"
script:
- composer validate
- composer install --optimize-autoloader
- if [ -n "$COMPOSER_UPDATE" ]; then
composer update --optimize-autoloader;
composer outdated;
fi
- vendor/bin/phpcs --version
- composer phpcs -- -s --report-full --report-summary --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-quality-report.json
artifacts:
expire_in: 1 week
expose_as: 'web-vendor'
paths:
- vendor/
reports:
codequality: phpcs-quality-report.json
'🧹 JavaScript linting (eslint)':
<<: [ *with-yarn ]
stage: 🪄 Lint
variables:
KUBERNETES_CPU_REQUEST: "2"
......@@ -356,6 +317,7 @@ default:
script:
- cd core
- corepack enable
- yarn install
- yarn run check:ckeditor5
- yarn run lint:core-js-passing --format gitlab
artifacts:
......@@ -363,7 +325,6 @@ default:
codequality: eslint-quality-report.json
'🧹 CSS linting (stylelint)':
<<: [ *with-yarn ]
stage: 🪄 Lint
variables:
KUBERNETES_CPU_REQUEST: "2"
......@@ -382,6 +343,7 @@ default:
script:
- corepack enable
- cd core
- yarn install
- yarn run build:css --check
- yarn run lint:css --color --custom-formatter=node_modules/stylelint-formatter-gitlab
artifacts:
......@@ -389,7 +351,7 @@ default:
codequality: stylelint-quality-report.json
'📔 Spell-checking':
<<: [ *with-yarn, *default-job-settings-lint ]
<<: [ *default-job-settings-lint ]
stage: 🪄 Lint
variables:
KUBERNETES_CPU_REQUEST: "2"
......@@ -401,8 +363,21 @@ default:
fi;
- cd core
- corepack enable
- yarn install
- git diff ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only 2>1 > /dev/null || (echo "Warning, cannot find changed files, converting to full clone." & (git fetch --unshallow --quiet && echo "Fetch successful."))
- git diff ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only | sed "s_^_../_" | yarn run spellcheck:core --no-must-find-files --file-list stdin
cache:
key:
files:
- ./core/package.json
- ./core/yarn.lock
paths:
- ./core/node_modules
artifacts:
expire_in: 1 week
expose_as: 'yarn-vendor'
paths:
- core/node_modules/
'📔 Validatable config':
<<: [ *default-job-settings-lint ]
......@@ -412,6 +387,7 @@ default:
_TARGET_PHP: "8.3-ubuntu"
# Run on MRs if config schema files have changed, or manually.
rules:
- if: $PERFORMANCE_TEST != "1"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- "**/config/schema/*.schema.yml"
......
......@@ -47,14 +47,14 @@ default:
.with-composer: &with-composer
needs:
- pipeline: $PARENT_PIPELINE_ID
job: '📦️ Composer'
job: '🧹 PHP Coding standards (PHPCS)'
.with-composer-and-yarn: &with-composer-and-yarn
needs:
- pipeline: $PARENT_PIPELINE_ID
job: '📦️ Composer'
job: '🧹 PHP Coding standards (PHPCS)'
- pipeline: $PARENT_PIPELINE_ID
job: '📦️ Yarn'
job: '📔 Spell-checking'
variables:
FF_NETWORK_PER_BUILD: 1
......@@ -248,7 +248,7 @@ variables:
- <<: *with-database
'🚲 Performance tests':
<<: [ *with-composer, *default-job-settings ]
<<: [ *default-job-settings ]
rules:
- if: $PERFORMANCE_TEST == "1"
variables:
......@@ -266,6 +266,7 @@ variables:
[[ $_TARGET_DB == mysql* ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql
[[ $_TARGET_DB == mariadb* ]] && export SIMPLETEST_DB=mysql://$MYSQL_USER:$MYSQL_PASSWORD@database/$MYSQL_DATABASE?module=mysql
[[ $_TARGET_DB == pgsql* ]] && export SIMPLETEST_DB=pgsql://$POSTGRES_USER:$POSTGRES_PASSWORD@database/$POSTGRES_DB?module=pgsql
- composer install --optimize-autoloader
- export OTEL_COLLECTOR="$OTEL_COLLECTOR"
- mkdir -p ./sites/simpletest ./sites/default/files ./build/logs/junit /var/www/.composer
- chown -R www-data:www-data ./sites ./build/logs/junit ./vendor /var/www/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment