Skip to content
Snippets Groups Projects
Commit 72dd01f3 authored by Adam G-H's avatar Adam G-H
Browse files

Issue #3415291: Run PHPStan on GitLab CI

parent 1bb711e0
No related branches found
No related tags found
1 merge request!1018Re-enable PHPStan job
Pipeline #78907 failed
......@@ -51,7 +51,6 @@ include:
variables:
_PHPUNIT_CONCURRENT: '1'
_PHPUNIT_TESTGROUPS: ''
SKIP_PHPSTAN: '1'
# SKIP_ESLINT: '1'
......@@ -101,20 +100,21 @@ variables:
#
###################################################################################
.extra-variables: &extra-variables
- MODULE_DIR=$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME
# Strip the `-dev` suffix out of $_TARGET_CORE to reveal the name of the Drupal core branch.
- CORE_BRANCH=`echo $_TARGET_CORE | sed -e "s/-dev$//"`
composer:
extends: .composer-base
before_script:
- composer archive --file=module
after_script:
# Ensure the module is physically located within the document root, not just
# symlinked from it.
- MODULE_DIR=$_WEB_ROOT/modules/custom/$CI_PROJECT_NAME
- *extra-variables
- rm -r -f $MODULE_DIR
- mkdir -p $MODULE_DIR
- tar -x -f module.tar -C $MODULE_DIR
- rm module.tar
# Strip the `-dev` suffix out of $_TARGET_CORE to reveal the name of the Drupal core branch.
- CORE_BRANCH=`echo $_TARGET_CORE | sed -e "s/-dev$//"`
- git clone https://git.drupalcode.org/project/drupal.git --depth 1 --branch $CORE_BRANCH /tmp/drupal-core
- mv /tmp/drupal-core/composer $_WEB_ROOT
......@@ -123,6 +123,12 @@ phpcs:
# Use core's PHPCS configuration.
- cp $_WEB_ROOT/core/phpcs.xml.dist .
phpstan:
before_script:
- *extra-variables
# Ensure our PHPStan configuration has the correct include path to core's PHPStan configuration.
- sed -i "s#%rootDir%/../../../#%rootDir%/../../../$_WEB_ROOT/#" $MODULE_DIR/phpstan.neon
phpunit:
parallel:
matrix:
......
File moved
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