From 5cb6498e35e6b813bf7b12ae85e661cb829f7927 Mon Sep 17 00:00:00 2001 From: catch <catch@35733.no-reply.drupal.org> Date: Mon, 12 Feb 2024 12:29:37 +0000 Subject: [PATCH] Issue #3420013 by longwave, catch: Only run CSS and JS lint jobs if files have changed --- .gitlab-ci.yml | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b6b1cd80d36d..28eee5b3320c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -375,36 +375,50 @@ default: codequality: phpcs-quality-report.json '🧹 JavaScript linting (eslint)': - <<: [ *with-yarn, *default-job-settings-lint ] + <<: [ *with-yarn ] stage: 🪄 Lint variables: KUBERNETES_CPU_REQUEST: "2" + # 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 script: + - yarn --cwd=./core run -s check:ckeditor5 - yarn --cwd=./core run -s lint:core-js-passing --format gitlab artifacts: reports: codequality: eslint-quality-report.json '🧹 CSS linting (stylelint)': - <<: [ *with-yarn, *default-job-settings-lint ] + <<: [ *with-yarn ] stage: 🪄 Lint variables: KUBERNETES_CPU_REQUEST: "2" + # 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 script: + - yarn run --cwd=./core build:css --check - yarn run --cwd=./core lint:css --color --custom-formatter=node_modules/stylelint-formatter-gitlab artifacts: reports: codequality: stylelint-quality-report.json -'🧹 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 - '📔 Spell-checking': <<: [ *with-yarn, *default-job-settings-lint ] stage: 🪄 Lint -- GitLab