Skip to content
Snippets Groups Projects
Commit 58d6bf04 authored by Jean Valverde's avatar Jean Valverde 🏗️ Committed by Mikael Meulle
Browse files

Issue #3464879 by mogtofu33: Ci add PHPMD job

parent 98ff2785
No related branches found
No related tags found
1 merge request!160Issue #3464879 by mogtofu33: [2.0.0-beta2] Ci add PHPMD job
Pipeline #239832 passed with warnings
......@@ -7,3 +7,37 @@ include:
- "/includes/include.drupalci.main.yml"
- "/includes/include.drupalci.variables.yml"
- "/includes/include.drupalci.workflows.yml"
.skip-phpmd-rule: &skip-phpmd-rule
if: '$SKIP_PHPMD == "1"'
when: never
.phpmd-base:
stage: validate
rules:
- !reference [.opt-in-current-rule]
- *skip-phpmd-rule
- !reference [.php-files-exist-rule]
needs:
- composer
before_script:
- curl -fsSL https://phpmd.org/static/latest/phpmd.phar -o vendor/bin/phpmd
- chmod +x vendor/bin/phpmd
script:
- php --version
- vendor/bin/phpmd --version
- vendor/bin/phpmd $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME gitlab $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME/.phpmd.xml --exclude 'tests/*,**/tests/*' > phpmd-quality-report.json || true
- vendor/bin/phpmd $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME text $_WEB_ROOT/modules/custom/$CI_PROJECT_NAME/.phpmd.xml --exclude 'tests/*,**/tests/*'
allow_failure: true
artifacts:
expose_as: phpmd
when: always
expire_in: 6 mos
reports:
codequality: phpmd-quality-report.json
name: artifacts-$CI_PIPELINE_ID-$CI_JOB_NAME_SLUG
paths:
- phpmd-quality-report.json
phpmd:
extends: .phpmd-base
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment