Skip to content
Snippets Groups Projects

Issue #3464879 by mogtofu33: [2.0.0-beta2] Ci add PHPMD job

1 file
+ 34
0
Compare changes
  • Side-by-side
  • Inline
+ 34
0
@@ -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
Loading