Skip to content
Snippets Groups Projects
Commit f4848230 authored by mscieszka's avatar mscieszka Committed by Fran Garcia-Linares
Browse files

Issue #3437397 by mscieszka, fjgarlin, jonathan1055: Add phpstan (max PHP version) job

parent 6e8ae8a1
No related branches found
No related tags found
1 merge request!169Issue #3437397: Add "phpstan (max PHP version)" job
Pipeline #135382 passed
......@@ -64,6 +64,7 @@ Each job will run or not run according to the following rules:
| phpcs | SKIP_PHPCS=0 | SKIP_PHPCS=1 |
| stylelint | SKIP_STYLELINT=0 | SKIP_STYLELINT=1 |
| phpstan | SKIP_PHPSTAN=0 && OPT_IN_TEST_CURRENT=1 | SKIP_PHPSTAN=1 \|\| OPT_IN_TEST_CURRENT=0 |
| phpstan (max PHP version) | SKIP_PHPSTAN=0 && OPT_IN_TEST_MAX_PHP=1 | SKIP_PHPSTAN=1 \|\| OPT_IN_TEST_MAX_PHP=0 |
| phpstan (next minor) | SKIP_PHPSTAN=0 && OPT_IN_TEST_NEXT_MINOR=1 | SKIP_PHPSTAN=1 \|\| OPT_IN_TEST_NEXT_MINOR=0 |
| phpstan (next major) | SKIP_PHPSTAN=0 && OPT_IN_TEST_NEXT_MAJOR=1 | SKIP_PHPSTAN=1 \|\| OPT_IN_TEST_NEXT_MAJOR=0 |
| nightwatch | SKIP_NIGHTWATCH=0 && OPT_IN_TEST_CURRENT=1 | SKIP_NIGHTWATCH=1 \|\| OPT_IN_TEST_CURRENT=0 |
......
......@@ -7,3 +7,7 @@ If there is a baseline file in the module it will use it, but if there isn't, it
It will offer a baseline file for module maintainers to add it to their projects to make adoption easier.
If you do not want it to run in your contrib module, you just need to set `SKIP_PHPSTAN` to 1.
This job allows multiple variants to check current and future versions of Drupal, as well as the maximum PHP version.
Consider the PHP version when interpreting the results of the PHPStan job, as the analysis may give different results between major versions of PHP.
......@@ -429,6 +429,7 @@ phpcs:
export PHPSTAN_CONFIGURATION=""
[[ -f $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME/phpstan.neon ]] && export PHPSTAN_CONFIGURATION="--configuration=$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME/phpstan.neon"
- php vendor/bin/phpstan --version
- php --version
# Rely on PHPStan caching to execute analysis multiple times without performance drawback.
# Output a copy in junit.
- php vendor/bin/phpstan analyze $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME $PHPSTAN_CONFIGURATION --error-format=junit > junit.xml || true
......@@ -460,6 +461,17 @@ phpcs:
phpstan:
extends: .phpstan-base
phpstan (max PHP version):
extends: phpstan
rules:
- *opt-in-max-php-rule
- *skip-phpstan-rule
- when: on_success
needs:
- "composer (max PHP version)"
variables:
_TARGET_PHP: $CORE_PHP_MAX
phpstan (next minor):
extends: phpstan
rules:
......
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