Skip to content
Snippets Groups Projects
Commit 4bb3e4fd authored by catch's avatar catch
Browse files

Issue #3387503 by bbrala: Move Gitlab linting steps to main job

(cherry picked from commit 1bdbe868)
parent 53dbbdc6
No related branches found
No related tags found
17 merge requests!11628Update file MediaLibraryWidget.php,!7564Revert "Issue #3364773 by roshnichordiya, Chris Matthews, thakurnishant_06,...,!5752Issue #3275828 by joachim, quietone, bradjones1, Berdir: document the reason...,!5627Issue #3261805: Field not saved when change of 0 on string start,!5427Issue #3338518: send credentials in ajax if configured in CORS settings.,!5395Issue #3387916 by fjgarlin, Spokje: Each GitLab job exposes user email,!5217Issue #3386607 by alexpott: Improve spell checking in commit-code-check.sh,!5064Issue #3379522 by finnsky, Gauravvvv, kostyashupenko, smustgrave, Chi: Revert...,!5040SDC ComponentElement: Transform slots scalar values to #plain_text instead of throwing an exception,!4958Issue #3392147: Whitelist IP for a Ban module.,!4894Issue #3280279: Add API to allow sites to opt in to upload SVG images in CKEditor 5,!4857Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!4856Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!3679Issue #115801: Allow password on registration without disabling e-mail verification,!3106Issue #3017548: "Filtered HTML" text format does not support manual teaser break (<!--break-->),!925Issue #2339235: Remove taxonomy hard dependency on node module,!872Draft: Issue #3221319: Race condition when creating menu links and editing content deletes menu links
Pipeline #20933 canceled
Pipeline: drupal

#20936

    # cspell:ignore drupaltestbot drupaltestbotpw codequality Micheh micheh
    ################
    # Drupal GitLabCI template.
    #
    ......@@ -46,6 +48,77 @@ variables:
    CONCURRENCY: 32
    GIT_DEPTH: "3"
    #############
    # Stages #
    #############
    stages:
    - 🏗️ Build
    - 🪄 Lint
    - 🗜️ Test
    #############
    # Templates #
    #############
    .default-job-settings: &default-job-settings-lint
    allow_failure: false
    variables:
    _TARGET_PHP: "8.2"
    _TARGET_DB: "mysql-8"
    image:
    name: $_CONFIG_DOCKERHUB_ROOT/php-$_TARGET_PHP-apache:production
    rules:
    - if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_ROOT_NAMESPACE == "project"
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
    .composer-cache: &composer-cache
    key:
    files:
    - ./composer.json
    - ./composer.lock
    paths:
    - ./vendor
    .yarn-cache: &yarn-cache
    key:
    files:
    - ./core/package.json
    - ./core/yarn.lock
    paths:
    - ./core/node_modules
    .pull-composer-cache: &pull-composer-cache
    cache:
    policy: pull
    <<: *composer-cache
    dependencies:
    - '📦️ Composer'
    .with-composer-cache: &with-composer-cache
    needs:
    - '📦️ Composer'
    <<: *pull-composer-cache
    .with-yarn-cache: &with-yarn-cache
    dependencies:
    - '📦️ Yarn'
    needs:
    - '📦️ Yarn'
    cache:
    policy: pull
    <<: *yarn-cache
    .junit-artifacts: &junit-artifacts
    artifacts:
    expose_as: junit
    expire_in: 6 mos
    paths:
    - junit.xml
    reports:
    junit: junit.xml
    ################
    # Stages
    #
    ......@@ -57,7 +130,7 @@ variables:
    ################
    .default-stage: &default-stage
    stage: test
    stage: 🗜️ Test
    trigger:
    # Rely on the status of the child pipeline.
    strategy: depend
    ......@@ -131,3 +204,82 @@ variables:
    # variables:
    # _TARGET_PHP: "8.1"
    # _TARGET_DB: "php-$_TARGET_PHP-apache"
    ################
    # Build Jobs for linting
    ################
    '📦️ Composer':
    <<: *default-job-settings-lint
    stage: 🏗️ Build
    cache:
    <<: *composer-cache
    artifacts:
    expire_in: 1 week
    expose_as: 'web-vendor'
    paths:
    - vendor/
    script:
    - export
    - composer validate
    - composer install
    '📦️ Yarn':
    <<: *default-job-settings-lint
    stage: 🏗️ Build
    cache:
    <<: *yarn-cache
    artifacts:
    expire_in: 1 week
    expose_as: 'yarn-vendor'
    paths:
    - core/node_modules/
    script:
    # Installs all core javascript dependencies and adds junit formatter.
    - yarn --cwd ./core add stylelint-junit-formatter
    ################
    # Lint Jobs
    ################
    '🧹 PHP Coding standards (PHPCS)':
    <<: [ *with-composer-cache, *junit-artifacts, *default-job-settings-lint ]
    stage: 🪄 Lint
    script:
    - composer phpcs -- --report-junit=junit.xml --report-full --report-summary
    '🧹 PHP Static Analysis (phpstan)':
    <<: [ *with-composer-cache, *junit-artifacts, *default-job-settings-lint ]
    stage: 🪄 Lint
    script:
    # Turn off apc to avoid corrupt composer cache.
    - php -d apc.enabled=0 -d apc.enable_cli=0 vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --error-format=junit > junit.xml
    '🧹 CSS linting (stylelint)':
    <<: [ *with-yarn-cache, *junit-artifacts, *default-job-settings-lint ]
    stage: 🪄 Lint
    script:
    - yarn run --cwd=./core lint:css --color --custom-formatter node_modules/stylelint-junit-formatter > junit.xml
    '🧹 Compilation check':
    <<: [ *with-yarn-cache, *default-job-settings-lint ]
    stage: 🪄 Lint
    script:
    - yarn run --cwd=./core build:css --check
    - cd core && yarn run -s check:ckeditor5
    '🧹 JavaScript linting (eslint)':
    <<: [ *with-yarn-cache, *junit-artifacts, *default-job-settings-lint ]
    stage: 🪄 Lint
    script:
    - yarn --cwd=./core run -s lint:core-js-passing --format junit > junit.xml
    '📔 Spell-checking':
    <<: [ *with-yarn-cache, *default-job-settings-lint ]
    stage: 🪄 Lint
    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"
    - export MODIFIED=`git diff --name-only refs/heads/$TARGET_BRANCH|while read r;do echo "$CI_PROJECT_DIR/$r";done|tr "\n" " "`
    - echo $MODIFIED | tr ' ' '\n' | yarn --cwd=./core run -s spellcheck:core --no-must-find-files --file-list stdin
    ......@@ -8,13 +8,6 @@ stages:
    ################
    - 🏗️ Build
    ################
    # Code quality checks
    #
    # This stage includes any codebase validation before running tests.
    ################
    - 🪄 Lint
    ################
    # Test
    #
    ......@@ -81,18 +74,6 @@ stages:
    reports:
    junit: junit.xml
    .with-linting: &with-linting
    needs:
    - '📦️ Composer'
    - '🧹 PHP Static Analysis (phpstan)'
    - '🧹 PHP Coding standards (PHPCS)'
    - '🧹 Compilation check'
    - '📦️ Yarn'
    - '📔 Spell-checking'
    - '🧹 JavaScript linting (eslint)'
    - '🧹 CSS linting (stylelint)'
    <<: *pull-composer-cache
    .with-unit-tests: &with-unit-tests
    needs:
    - '⚡️ PHPUnit Unit'
    ......@@ -210,51 +191,6 @@ stages:
    # Installs all core javascript dependencies and adds junit formatter.
    - yarn --cwd ./core add stylelint-junit-formatter
    ################
    # Lint Jobs
    ################
    '🧹 PHP Coding standards (PHPCS)':
    <<: [ *with-composer-cache, *junit-artifacts, *default-job-settings ]
    stage: 🪄 Lint
    script:
    - composer phpcs -- --report-junit=junit.xml --report-full --report-summary
    '🧹 PHP Static Analysis (phpstan)':
    <<: [ *with-composer-cache, *junit-artifacts, *default-job-settings ]
    stage: 🪄 Lint
    script:
    # Turn off apc to avoid corrupt composer cache.
    - php -d apc.enabled=0 -d apc.enable_cli=0 vendor/bin/phpstan analyze --configuration=./core/phpstan.neon.dist --error-format=junit > junit.xml
    '🧹 CSS linting (stylelint)':
    <<: [ *with-yarn-cache, *junit-artifacts, *default-job-settings ]
    stage: 🪄 Lint
    script:
    - yarn run --cwd=./core lint:css --color --custom-formatter node_modules/stylelint-junit-formatter > junit.xml
    '🧹 Compilation check':
    <<: [ *with-yarn-cache, *default-job-settings ]
    stage: 🪄 Lint
    script:
    - yarn run --cwd=./core build:css --check
    - cd core && yarn run -s check:ckeditor5
    '🧹 JavaScript linting (eslint)':
    <<: [ *with-yarn-cache, *junit-artifacts, *default-job-settings ]
    stage: 🪄 Lint
    script:
    - yarn --cwd=./core run -s lint:core-js-passing --format junit > junit.xml
    '📔 Spell-checking':
    <<: [ *with-yarn-cache, *default-job-settings ]
    stage: 🪄 Lint
    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"
    - export MODIFIED=`git diff --name-only refs/heads/$TARGET_BRANCH|while read r;do echo "$CI_PROJECT_DIR/$r";done|tr "\n" " "`
    - echo $MODIFIED | tr ' ' '\n' | yarn --cwd=./core run -s spellcheck:core --no-must-find-files --file-list stdin
    ################
    # Test Jobs
    ################
    ......@@ -271,10 +207,20 @@ stages:
    TESTSUITE: PHPUnit-Unit
    CONCURRENCY: "$CONCURRENCY"
    '🌐️️ PHPUnit Functional':
    <<: [ *with-unit-tests, *phpunit-artifacts, *setup-webserver, *run-tests, *default-job-settings ]
    stage: 🗜️ Test
    parallel: 6
    variables:
    <<: *test-variables
    TESTSUITE: PHPUnit-Functional
    CONCURRENCY: "$CONCURRENCY"
    services:
    - <<: *with-database
    '⚙️️ PHPUnit Kernel':
    <<: [ *with-composer-cache, *phpunit-artifacts, *setup-webserver, *run-tests, *default-job-settings ]
    <<: [*with-unit-tests, *phpunit-artifacts, *setup-webserver, *run-tests, *default-job-settings ]
    stage: 🗜️ Test
    parallel: 3
    variables:
    <<: *test-variables
    TESTSUITE: PHPUnit-Kernel
    ......@@ -283,7 +229,7 @@ stages:
    - <<: *with-database
    '🖱️️️ PHPUnit Functional Javascript':
    <<: [ *with-linting, *with-unit-tests, *phpunit-artifacts, *setup-webserver, *run-tests, *default-job-settings ]
    <<: [ *with-unit-tests, *phpunit-artifacts, *setup-webserver, *run-tests, *default-job-settings ]
    stage: 🗜️ Test
    variables:
    <<: *test-variables
    ......@@ -294,7 +240,7 @@ stages:
    - <<: *with-chrome
    '👷️️️ PHPUnit Build':
    <<: [ *with-linting, *with-unit-tests, *phpunit-artifacts, *setup-webserver, *run-tests, *default-job-settings ]
    <<: [ *with-unit-tests, *phpunit-artifacts, *setup-webserver, *run-tests, *default-job-settings ]
    stage: 🗜️ Test
    variables:
    <<: *test-variables
    ......@@ -303,17 +249,6 @@ stages:
    services:
    - <<: *with-database
    '🌐️️ PHPUnit Functional':
    <<: [ *with-linting, *with-unit-tests, *phpunit-artifacts, *setup-webserver, *run-tests, *default-job-settings ]
    stage: 🗜️ Test
    parallel: 8
    variables:
    <<: *test-variables
    TESTSUITE: PHPUnit-Functional
    CONCURRENCY: "$CONCURRENCY"
    services:
    - <<: *with-database
    '🦉️️️ Nightwatch':
    <<: [ *with-composer-yarn-and-unit-tests, *setup-webserver, *default-job-settings ]
    stage: 🗜️ Test
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment