2024-02-28 23:06:05 +00:00
# cspell:ignore codequality Micheh micheh webide
2023-09-16 09:08:36 +00:00
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
################
# Drupal GitLabCI template.
#
# Based off GitlabCI templates project: https://git.drupalcode.org/project/gitlab_templates
# Guide: https://www.drupal.org/docs/develop/git/using-gitlab-to-contribute-to-drupal/gitlab-ci
#
# With thanks to:
# - The GitLab Acceleration Initiative participants
# - DrupalSpoons
################
################
2024-02-28 23:06:05 +00:00
# Workflow
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
#
2024-02-28 23:06:05 +00:00
# Define conditions for when the pipeline will run.
# For example:
# * On commit
# * On merge request
# * On manual trigger
# * etc.
# https://docs.gitlab.com/ee/ci/jobs/job_control.html#specify-when-jobs-run-with-rules
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
#
2024-02-28 23:06:05 +00:00
# Pipelines can also be configured to run on a schedule,though they still must meet the conditions defined in Workflow and Rules. This can be used, for example, to do nightly regression testing:
# https://gitlab.com/help/ci/pipelines/schedules
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
################
2024-02-28 23:06:05 +00:00
workflow :
rules :
# These 3 rules from https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Workflows/MergeRequest-Pipelines.gitlab-ci.yml
# Run on merge requests
- if : $CI_PIPELINE_SOURCE == 'merge_request_event'
# Run when called from an upstream pipeline https://docs.gitlab.com/ee/ci/pipelines/downstream_pipelines.html?tab=Multi-project+pipeline#use-rules-to-control-downstream-pipeline-jobs
- if : $CI_PIPELINE_SOURCE == 'pipeline'
2024-03-17 11:11:55 +00:00
# Run when called from a parent pipeline (e.g. updated dependencies job)
- if : $CI_PIPELINE_SOURCE == 'parent_pipeline'
2024-02-28 23:06:05 +00:00
# Run on commits.
- if : $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_ROOT_NAMESPACE == "project"
# The last rule above blocks manual and scheduled pipelines on non-default branch. The rule below allows them:
- if : $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_ROOT_NAMESPACE == "project"
# Run if triggered from Web using 'Run Pipelines'
- if : $CI_PIPELINE_SOURCE == "web"
# Run if triggered from WebIDE
- if : $CI_PIPELINE_SOURCE == "webide"
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
################
# Variables
#
# Overriding variables
# - To override one or more of these variables, simply declare your own variables keyword.
# - Keywords declared directly in .gitlab-ci.yml take precedence over include files.
# - Documentation: https://docs.gitlab.com/ee/ci/variables/
# - Predefined variables: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
#
################
variables :
2024-02-28 23:06:05 +00:00
_CONFIG_DOCKERHUB_ROOT : "drupalci"
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
# Let composer know what self.version means.
2023-09-13 11:56:02 +00:00
COMPOSER_ROOT_VERSION : "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}${CI_COMMIT_BRANCH}-dev"
2024-04-13 09:44:33 +00:00
COMPOSER_ALLOW_SUPERUSER : 1
2023-10-04 08:52:51 +00:00
CONCURRENCY : 24
2024-01-27 17:24:34 +00:00
GIT_DEPTH : "50"
2023-10-05 06:52:57 +00:00
PARENT_PIPELINE_ID : $CI_PIPELINE_ID
2023-11-15 10:40:40 +00:00
_TARGET_PHP : "8.2"
2023-09-16 09:08:36 +00:00
#############
# Stages #
#############
stages :
- 🏗️ Build
- 🪄 Lint
- 🗜️ Test
#############
2023-11-15 10:40:40 +00:00
# Defaults #
2023-09-16 09:08:36 +00:00
#############
2023-11-15 10:40:40 +00:00
default :
2023-09-18 15:10:24 +00:00
interruptible : true
2023-10-04 14:58:47 +00:00
retry :
max : 2
when :
- unknown_failure
- api_failure
- stuck_or_timeout_failure
- runner_system_failure
- scheduler_failure
2023-09-16 09:08:36 +00:00
image :
name : $_CONFIG_DOCKERHUB_ROOT/php-$_TARGET_PHP-apache:production
2023-11-15 10:40:40 +00:00
#############
# Templates #
#############
2023-10-05 06:52:57 +00:00
.with-composer : &with-composer
2023-09-28 20:04:17 +00:00
needs :
2023-09-16 09:08:36 +00:00
- '📦️ Composer'
2023-10-05 06:52:57 +00:00
.with-yarn : &with-yarn
2023-09-28 20:04:17 +00:00
needs :
2023-09-16 09:08:36 +00:00
- '📦️ Yarn'
2023-11-03 15:17:09 +00:00
.default-job-settings-lint : &default-job-settings-lint
rules :
- if : $PERFORMANCE_TEST != "1"
2023-09-16 09:08:36 +00:00
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
################
# Stages
#
# Each job is assigned to a stage, defining the order in which the jobs are executed.
# Jobs in the same stage run in parallel.
#
# If all jobs in a stage succeed, the pipeline will proceed to the next stage.
# If any job in the stage fails, the pipeline will exit early.
################
.default-stage : &default-stage
2023-09-16 09:08:36 +00:00
stage : 🗜️ Test
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
trigger :
# Rely on the status of the child pipeline.
strategy : depend
include :
- local : .gitlab-ci/pipeline.yml
2023-09-15 08:41:49 +00:00
.run-on-commit : &run-on-commit
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
rules :
2023-09-15 08:41:49 +00:00
- if : $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_ROOT_NAMESPACE == "project"
2023-11-30 11:28:20 +00:00
allow_failure : true
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
2023-09-15 08:41:49 +00:00
.run-daily : &run-daily
rules :
2023-11-03 15:17:09 +00:00
- if : $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_ROOT_NAMESPACE == "project" && $DAILY_TEST == "1"
2023-11-30 11:28:20 +00:00
allow_failure : true
2023-11-29 23:33:02 +00:00
.run-on-mr : &run-on-mr
rules :
2023-09-15 08:41:49 +00:00
- if : $CI_PIPELINE_SOURCE == "merge_request_event"
when : manual
allow_failure : true
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
2023-09-15 08:41:49 +00:00
# Default configuration.
2023-11-23 10:33:20 +00:00
'DEFAULT : PHP 8.2 MySQL 8' :
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
<< : *default-stage
variables :
2023-09-15 08:41:49 +00:00
_TARGET_PHP : "8.2"
_TARGET_DB : "mysql-8"
2023-11-03 15:17:09 +00:00
PERFORMANCE_TEST : $PERFORMANCE_TEST
OTEL_COLLECTOR : $OTEL_COLLECTOR
2024-03-01 12:07:04 +00:00
# Run on MR, schedule, push, parent pipeline and performance test.
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
rules :
2023-09-13 10:21:14 +00:00
- if : $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_ROOT_NAMESPACE == "project"
2023-11-30 11:28:20 +00:00
allow_failure : true
2023-11-29 23:33:02 +00:00
- if : $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_ROOT_NAMESPACE == "project" && $DAILY_TEST == "1"
2023-11-30 11:28:20 +00:00
allow_failure : true
2023-09-15 08:41:49 +00:00
- if : $CI_PIPELINE_SOURCE == "merge_request_event"
2024-03-01 12:07:04 +00:00
- if : $CI_PIPELINE_SOURCE == "parent_pipeline"
2023-11-03 15:17:09 +00:00
- if : $PERFORMANCE_TEST == "1"
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
2024-03-01 12:07:04 +00:00
# Re-run the pipeline, but with Composer updates.
'DEFAULT : Updated dependencies (PHP 8.2 MySQL 8)' :
<< : *default-stage
# Run daily and allow manual runs on MRs.
rules :
- if : $CI_PIPELINE_SOURCE == "schedule" && $CI_PROJECT_ROOT_NAMESPACE == "project" && $DAILY_TEST == "1"
allow_failure : true
- if : $CI_PIPELINE_SOURCE == "merge_request_event"
when : manual
allow_failure : true
variables :
COMPOSER_UPDATE : "1"
trigger :
include : .gitlab-ci.yml
2023-11-29 23:33:02 +00:00
# Special job for MRs for test-only checks.
2023-11-29 13:13:29 +00:00
'DEFAULT : Test-only (PHP 8.2 MySQL 8)' :
2023-11-23 10:33:20 +00:00
<< : [ *default-stage, *with-composer ]
when : manual
allow_failure : true
variables :
_TARGET_PHP : "8.2"
_TARGET_DB : "mysql-8"
rules :
- if : $CI_PIPELINE_SOURCE == "merge_request_event"
trigger :
# Rely on the status of the child pipeline.
strategy : depend
include :
- local : .gitlab-ci/pipeline-test-only.yml
2023-11-29 23:33:02 +00:00
# Main listing of jobs.
# All of these are available on Merge Requests and also work as base jobs for
# on-commit and daily jobs to extend from.
2023-09-15 08:41:49 +00:00
'PHP 8.1 MySQL 5.7' :
2023-11-29 23:33:02 +00:00
<< : [ *default-stage, *run-on-mr ]
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
variables :
2023-09-15 08:41:49 +00:00
_TARGET_PHP : "8.1"
_TARGET_DB : "mysql-5.7"
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
'PHP 8.2 PostgreSQL 14.1' :
2023-11-29 23:33:02 +00:00
<< : [ *default-stage, *run-on-mr ]
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
variables :
2023-09-15 08:41:49 +00:00
_TARGET_PHP : "8.2"
_TARGET_DB : "pgsql-14.1"
2023-09-18 20:03:35 +00:00
'PHP 8.2 PostgreSQL 15' :
2023-11-29 23:33:02 +00:00
<< : [ *default-stage, *run-on-mr ]
2023-09-18 20:03:35 +00:00
variables :
_TARGET_PHP : "8.2"
_TARGET_DB : "pgsql-15"
'PHP 8.2 PostgreSQL 16' :
2023-11-29 23:33:02 +00:00
<< : [ *default-stage, *run-on-mr ]
2023-09-18 20:03:35 +00:00
variables :
_TARGET_PHP : "8.2"
_TARGET_DB : "pgsql-16"
2023-09-29 16:01:46 +00:00
'PHP 8.2 SQLite 3' :
2023-11-29 23:33:02 +00:00
<< : [ *default-stage, *run-on-mr ]
2023-09-29 16:01:46 +00:00
variables :
_TARGET_PHP : "8.2"
_TARGET_DB : "sqlite-3"
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
2023-10-31 11:18:42 +00:00
'PHP 8.3 MySQL 8' :
2023-11-29 23:33:02 +00:00
<< : [ *default-stage, *run-on-mr ]
2023-10-31 11:18:42 +00:00
variables :
_TARGET_PHP : "8.3"
_TARGET_DB : "mysql-8"
'PHP 8.3 PostgreSQL 16' :
2023-11-29 23:33:02 +00:00
<< : [ *default-stage, *run-on-mr ]
2023-10-31 11:18:42 +00:00
variables :
_TARGET_PHP : "8.3"
_TARGET_DB : "pgsql-16"
'PHP 8.3 SQLite 3' :
2023-11-29 23:33:02 +00:00
<< : [ *default-stage, *run-on-mr ]
2023-10-31 11:18:42 +00:00
variables :
_TARGET_PHP : "8.3"
_TARGET_DB : "sqlite-3"
2023-11-24 12:48:52 +00:00
'PHP 8.1 MariaDB 10.3.22' :
2023-11-29 23:33:02 +00:00
<< : [ *default-stage, *run-on-mr ]
2023-11-24 12:48:52 +00:00
variables :
_TARGET_PHP : "8.1"
_TARGET_DB : "mariadb-10.3.22"
2023-09-15 08:41:49 +00:00
'PHP 8.1 PostgreSQL 14.1' :
2023-11-29 23:33:02 +00:00
<< : [ *default-stage, *run-on-mr ]
2023-09-15 08:41:49 +00:00
variables :
_TARGET_PHP : "8.1"
_TARGET_DB : "pgsql-14.1"
Issue #3386076 by fjgarlin, catch, longwave, larowlan, mstrelan, el7cosmos, RoSk0, xurizaemon, poker10, alexpott, bbrala, nick_schuch: GitLab CI integration for core
2023-09-13 09:32:38 +00:00
2023-09-29 16:01:46 +00:00
'PHP 8.1 SQLite 3' :
2023-11-29 23:33:02 +00:00
<< : [ *default-stage, *run-on-mr ]
2023-09-29 16:01:46 +00:00
variables :
_TARGET_PHP : "8.1"
_TARGET_DB : "sqlite-3"
2023-09-16 09:08:36 +00:00
2023-11-29 23:33:02 +00:00
# Jobs running on commits.
# The value set in the "needs" property will determine the order in the sequence.
'[Commit] PHP 8.1 MySQL 5.7' :
extends : 'PHP 8.1 MySQL 5.7'
needs: [ 'DEFAULT : PHP 8.2 MySQL 8' ]
<< : [ *run-on-commit ]
'[Commit] PHP 8.2 PostgreSQL 16' :
extends : 'PHP 8.2 PostgreSQL 16'
needs : [ '[Commit] PHP 8.1 MySQL 5.7' ]
<< : [ *run-on-commit ]
'[Commit] PHP 8.2 SQLite 3' :
extends : 'PHP 8.2 SQLite 3'
needs : [ '[Commit] PHP 8.2 PostgreSQL 16' ]
<< : [ *run-on-commit ]
# Jobs running daily.
# The value set in the "needs" property will determine the order in the sequence.
'[Daily] PHP 8.2 PostgreSQL 14.1' :
extends : 'PHP 8.2 PostgreSQL 14.1'
needs: [ 'DEFAULT : PHP 8.2 MySQL 8' ]
<< : [ *run-daily ]
'[Daily] PHP 8.2 PostgreSQL 15' :
extends : 'PHP 8.2 PostgreSQL 15'
needs : [ '[Daily] PHP 8.2 PostgreSQL 14.1' ]
<< : [ *run-daily ]
'[Daily] PHP 8.3 MySQL 8' :
extends : 'PHP 8.3 MySQL 8'
needs : [ '[Daily] PHP 8.2 PostgreSQL 15' ]
<< : [ *run-daily ]
'[Daily] PHP 8.3 PostgreSQL 16' :
extends : 'PHP 8.3 PostgreSQL 16'
needs : [ '[Daily] PHP 8.3 MySQL 8' ]
<< : [ *run-daily ]
'[Daily] PHP 8.3 SQLite 3' :
extends : 'PHP 8.3 SQLite 3'
needs : [ '[Daily] PHP 8.3 PostgreSQL 16' ]
<< : [ *run-daily ]
'[Daily] PHP 8.1 MariaDB 10.3.22' :
extends : 'PHP 8.1 MariaDB 10.3.22'
needs : [ '[Daily] PHP 8.3 SQLite 3' ]
<< : [ *run-daily ]
'[Daily] PHP 8.1 PostgreSQL 14.1' :
extends : 'PHP 8.1 PostgreSQL 14.1'
needs : [ '[Daily] PHP 8.1 MariaDB 10.3.22' ]
<< : [ *run-daily ]
'[Daily] PHP 8.1 SQLite 3' :
extends : 'PHP 8.1 SQLite 3'
needs : [ '[Daily] PHP 8.1 PostgreSQL 14.1' ]
<< : [ *run-daily ]
2023-09-16 09:08:36 +00:00
################
# Build Jobs for linting
################
'📦️ Composer' :
2023-11-02 22:49:46 +00:00
variables :
KUBERNETES_CPU_REQUEST : "1"
2023-09-16 09:08:36 +00:00
stage : 🏗️ Build
cache :
2023-10-05 06:52:57 +00:00
key :
files :
- ./composer.json
- ./composer.lock
paths :
- ./vendor
2023-09-16 09:08:36 +00:00
artifacts :
expire_in : 1 week
expose_as : 'web-vendor'
paths :
- vendor/
script :
- composer validate
- composer install
2024-03-01 12:07:04 +00:00
- if [ -n "$COMPOSER_UPDATE" ]; then
composer update;
composer outdated;
fi
2023-09-16 09:08:36 +00:00
'📦️ Yarn' :
2023-11-02 22:49:46 +00:00
variables :
KUBERNETES_CPU_REQUEST : "2"
2023-09-16 09:08:36 +00:00
stage : 🏗️ Build
cache :
2023-10-05 06:52:57 +00:00
key :
files :
- ./core/package.json
- ./core/yarn.lock
paths :
- ./core/node_modules
2023-09-16 09:08:36 +00:00
artifacts :
expire_in : 1 week
expose_as : 'yarn-vendor'
paths :
- core/node_modules/
script :
2023-09-19 13:27:24 +00:00
- yarn --cwd ./core install
2023-09-16 09:08:36 +00:00
################
# Lint Jobs
################
2023-09-28 20:04:17 +00:00
'🧹 PHP Static Analysis (phpstan)' :
2023-11-15 10:40:40 +00:00
<< : [ *with-composer, *default-job-settings-lint ]
2023-09-16 09:08:36 +00:00
stage : 🪄 Lint
2023-11-02 22:49:46 +00:00
variables :
KUBERNETES_CPU_REQUEST : "16"
2023-09-16 09:08:36 +00:00
script :
2024-03-01 12:07:04 +00:00
- vendor/bin/phpstan --version
2023-11-23 17:19:11 +00:00
# Rely on PHPStan caching to execute analysis multiple times without performance drawback.
# Output a copy in junit.
- php vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --error-format=gitlab > phpstan-quality-report.json || EXIT_CODE=$?
- php vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --no-progress --error-format=junit > phpstan-junit.xml || true
- |
if [ -n "$EXIT_CODE" ]; then
# Output a copy in plain text for human logs.
php vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --no-progress || true
# Generate a new baseline.
echo "Generating an PHPStan baseline file (available as job artifact)."
2024-03-12 14:43:35 +00:00
php vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --no-progress --generate-baseline=./core/.phpstan-baseline.php || true
2023-11-23 17:19:11 +00:00
exit $EXIT_CODE
fi
2023-09-19 13:27:24 +00:00
artifacts :
reports :
2023-09-28 20:04:17 +00:00
codequality : phpstan-quality-report.json
2023-11-23 17:19:11 +00:00
junit : phpstan-junit.xml
# Only store the baseline if the job fails.
when : on_failure
paths :
2024-03-12 14:43:35 +00:00
- core/.phpstan-baseline.php
2023-09-16 09:08:36 +00:00
2023-09-28 20:04:17 +00:00
'🧹 PHP Coding standards (PHPCS)' :
2023-11-15 10:40:40 +00:00
<< : [ *with-composer, *default-job-settings-lint ]
2023-09-16 09:08:36 +00:00
stage : 🪄 Lint
2023-11-02 22:49:46 +00:00
variables :
KUBERNETES_CPU_REQUEST : "16"
2023-09-16 09:08:36 +00:00
script :
2024-03-01 12:07:04 +00:00
- vendor/bin/phpcs --version
2023-09-28 20:04:17 +00:00
- composer phpcs -- --report-full --report-summary --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-quality-report.json
2023-09-19 13:27:24 +00:00
artifacts :
reports :
2023-09-28 20:04:17 +00:00
codequality : phpcs-quality-report.json
2023-09-16 09:08:36 +00:00
2023-10-04 08:52:51 +00:00
'🧹 JavaScript linting (eslint)' :
2024-02-12 12:29:37 +00:00
<< : [ *with-yarn ]
2023-10-04 08:52:51 +00:00
stage : 🪄 Lint
2023-11-02 22:49:46 +00:00
variables :
KUBERNETES_CPU_REQUEST : "2"
2024-02-12 12:29:37 +00:00
# Run on push, or on MRs if CSS files have changed, or manually.
rules :
- if : $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_ROOT_NAMESPACE == "project"
- if : $CI_PIPELINE_SOURCE == "merge_request_event"
changes :
- core/package.json
- core/yarn.lock
- "**/*.js"
- "**/*.yml"
- when : manual
allow_failure : true
2023-10-04 08:52:51 +00:00
script :
2024-02-12 12:29:37 +00:00
- yarn --cwd=./core run -s check:ckeditor5
2023-10-04 08:52:51 +00:00
- yarn --cwd=./core run -s lint:core-js-passing --format gitlab
artifacts :
reports :
codequality : eslint-quality-report.json
2023-09-16 09:08:36 +00:00
'🧹 CSS linting (stylelint)' :
2024-02-12 12:29:37 +00:00
<< : [ *with-yarn ]
2023-09-16 09:08:36 +00:00
stage : 🪄 Lint
2023-11-02 22:49:46 +00:00
variables :
KUBERNETES_CPU_REQUEST : "2"
2024-02-12 12:29:37 +00:00
# Run on push, or on MRs if CSS files have changed, or manually.
rules :
- if : $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_ROOT_NAMESPACE == "project"
- if : $CI_PIPELINE_SOURCE == "merge_request_event"
changes :
- core/package.json
- core/yarn.lock
- "**/*.css"
- when : manual
allow_failure : true
2023-09-16 09:08:36 +00:00
script :
2024-02-12 12:29:37 +00:00
- yarn run --cwd=./core build:css --check
2023-09-19 13:27:24 +00:00
- yarn run --cwd=./core lint:css --color --custom-formatter=node_modules/stylelint-formatter-gitlab
artifacts :
reports :
codequality : stylelint-quality-report.json
2023-09-16 09:08:36 +00:00
'📔 Spell-checking' :
2023-10-05 06:52:57 +00:00
<< : [ *with-yarn, *default-job-settings-lint ]
2023-09-16 09:08:36 +00:00
stage : 🪄 Lint
2023-11-02 22:49:46 +00:00
variables :
KUBERNETES_CPU_REQUEST : "2"
2023-09-16 09:08:36 +00:00
script :
2024-02-05 09:18:36 +00:00
- if [ -n "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA" ]; then
echo "HEAD is $(git rev-parse HEAD). \$CI_MERGE_REQUEST_TARGET_BRANCH_SHA is ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA}";
else
echo "HEAD is $(git rev-parse HEAD). \$CI_MERGE_REQUEST_DIFF_BASE_SHA is ${CI_MERGE_REQUEST_DIFF_BASE_SHA}";
fi;
- git diff ${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA} --name-only | sed "s_^_../_" | yarn --cwd=./core run -s spellcheck:core --no-must-find-files --file-list stdin