Skip to content
Snippets Groups Projects
Verified Commit c56ebfb7 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3462763 by catch, bbrala, andypost: Use artifacts to share the phpstan...

Issue #3462763 by catch, bbrala, andypost: Use artifacts to share the phpstan result and cspell caches from core to MRs
parent 2d94b30e
No related branches found
No related tags found
20 merge requests!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!9470[10.3.x-only-DO-NOT-MERGE]: #3331771 Fix file_get_contents(): Passing null to parameter,!8736Update the Documention As per the Function uses.,!8513Issue #3453786: DefaultSelection should document why values for target_bundles NULL and [] behave as they do,!3878Removed unused condition head title for views,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3133core/modules/system/css/components/hidden.module.css,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2062Issue #3246454: Add weekly granularity to views date sort,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #239263 canceled
Pipeline: drupal

#239264

    ......@@ -57,6 +57,7 @@ workflow:
    variables:
    _CONFIG_DOCKERHUB_ROOT: "drupalci"
    CACHE_TARGET: "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}${CI_COMMIT_BRANCH}"
    # Let composer know what self.version means.
    COMPOSER_ROOT_VERSION: "${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}${CI_COMMIT_BRANCH}-dev"
    COMPOSER_ALLOW_SUPERUSER: 1
    ......@@ -101,7 +102,24 @@ default:
    rules:
    - if: $PERFORMANCE_TEST != "1"
    .phpstan-cache: &phpstan-cache
    # Get the phpstan cache file from the artifacts of the latest successful
    # job from the target branch. Allow the job to proceed and pass if the file
    # doesn't exist.
    - mkdir core/phpstan-tmp
    - 'curl --location --output core/phpstan-tmp/resultCache.php "https://git.drupalcode.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/{$CACHE_TARGET}/raw/core/phpstan-tmp/resultCache.php?job=Lint%20cache%20warming&job_token=$CI_JOB_TOKEN" || true'
    .cspell-cache: &cspell-cache
    # Fetch the cspell cache from the artifacts of the latest successful job from
    # the target branch. Allow the job to proceed and pass if the file doesn't
    # exist.
    - 'curl --location --output core/.cspellcache "https://git.drupalcode.org/api/v4/projects/$CI_PROJECT_ID/jobs/artifacts/{$CACHE_TARGET}/raw/core/.cspellcache?job=Lint%20cache%20warming&job_token=$CI_JOB_TOKEN" || true'
    .core-spellcheck: &core-spellcheck
    - cd core
    - corepack enable
    - yarn install
    - yarn run spellcheck:core --no-must-find-files --cache --cache-strategy content
    ################
    # Stages
    #
    ......@@ -239,12 +257,35 @@ default:
    # Lint Jobs
    ################
    'Lint cache warming':
    <<: [ *default-job-settings-lint ]
    stage: 🪄 Lint
    rules:
    - if: $CI_PIPELINE_SOURCE == "push" && $CI_PROJECT_ROOT_NAMESPACE == "project"
    - when: manual
    allow_failure: true
    variables:
    KUBERNETES_CPU_REQUEST: "4"
    script:
    - *phpstan-cache
    - *cspell-cache
    - composer install
    - vendor/bin/phpstan --version
    - php vendor/bin/phpstan -vvv analyze --configuration=./core/phpstan.neon.dist
    - *core-spellcheck
    artifacts:
    paths:
    - core/phpstan-tmp/resultCache.php
    - core/.cspellcache
    '🧹 PHP Static Analysis (phpstan)':
    <<: [ *default-job-settings-lint ]
    stage: 🪄 Lint
    variables:
    KUBERNETES_CPU_REQUEST: "16"
    KUBERNETES_CPU_REQUEST: "4"
    script:
    - *phpstan-cache
    - composer validate
    - composer install --optimize-autoloader
    - if [ -n "$COMPOSER_UPDATE" ]; then
    ......@@ -254,8 +295,8 @@ default:
    - vendor/bin/phpstan --version
    # 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
    - php vendor/bin/phpstan -vvv analyze --configuration=./core/phpstan.neon.dist --error-format=gitlab > phpstan-quality-report.json || EXIT_CODE=$?
    - php vendor/bin/phpstan -vvv 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.
    ......@@ -267,11 +308,11 @@ default:
    fi
    artifacts:
    # Only store the baseline if the job fails.
    when: on_failure
    reports:
    codequality: phpstan-quality-report.json
    junit: phpstan-junit.xml
    # Only store the baseline if the job fails.
    when: on_failure
    paths:
    - core/.phpstan-baseline.php
    ......@@ -356,16 +397,8 @@ default:
    variables:
    KUBERNETES_CPU_REQUEST: "2"
    script:
    - 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;
    - 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
    - *cspell-cache
    - *core-spellcheck
    cache:
    key:
    files:
    ......
    ......@@ -26,3 +26,6 @@ nightwatch.settings.json
    # Ignore CSpell cache
    .cspellcache
    # Ignore phpstan cache
    phpstan-tmp
    ......@@ -6,6 +6,8 @@ includes:
    parameters:
    tmpDir: phpstan-tmp
    level: 1
    fileExtensions:
    ......@@ -26,6 +28,8 @@ parameters:
    - ../*/node_modules/*
    - */tests/fixtures/*.php
    - */tests/fixtures/*.php.gz
    # Skip the phpstan tmpDir
    - phpstan-tmp/*
    # Skip Drupal's own PHPStan rules test fixtures.
    - tests/PHPStan/fixtures/*
    # Skip Drupal 6 & 7 code.
    ......
    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