Skip to content
Snippets Groups Projects
Select Git revision
  • e961cc4b6bfd1505aff7cc293a52e5364dbb359c
  • master default protected
  • feat/npm-publish
  • feat/demo-deploy
  • change-demo-deploy
  • remove-smoke
  • feat/acceptance-tests
  • feature/deploy-composer.json
  • feature/mysql-bin-logs
  • skip-codecept-for-libs
  • include-composer-json
  • exclude-wp-assets
  • update_codecept_image
  • fix/silenced-copy
  • remove-free-translations
  • codeception-with-optional-step
  • improve-parallelization
  • linter-exit
  • change-images
  • fix/linter
  • globally-raise-mem-limit
  • no-symlink2
22 results

static-analysis.yml

Blame
  • static-analysis.yml 1.23 KiB
    .static-analysis: &static-tmpl
      image: gitlab.wpdesk.dev:5050/wpdesk/docker-tests/php-box:8.2
      needs:
        - prepare prefixed vendor
      stage: tests
      extends: .skip-mr
    
    # Run phpstan in strict mode (failing pipeline) only if we have baseline, otherwise allow to fail with a warning, suggesting to create one. This behavior will change at the end of the year, when any PHPStan failure will be considered fatal
    phpstan:
      <<: *static-tmpl
      script:
        - |
          if [ -f "vendor/bin/phpstan" ]; then
            vendor/bin/phpstan analyse --memory-limit=2G
          elif [ -f "vendor/wpdesk/wp-wpdesk-composer/director/vendor/bin/phpstan" ]; then
            # PHPStan installed by director
            vendor/wpdesk/wp-wpdesk-composer/director/vendor/bin/phpstan analyse --memory-limit=2G
          else
            echo "PHPStan not found! Install it with 'composer require --dev wpdesk/phpstan-rules'."
            # We will be able to use custom exit after removing rules.allow_failure part
            # exit 125
          fi
      allow_failure: true
      rules:
        - exists:
          - .phpstan-baseline.php
          - .phpstan-baseline.neon
          allow_failure: false
    
    phpcs:
      <<: *static-tmpl
      script:
        - vendor/bin/phpcs
      allow_failure: true
      rules:
        - exists:
          - phpcs.xml.dist