From c53353ca789bbe8c178fccee7a110b2fd3637167 Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Mon, 29 Jan 2024 09:18:50 +0000 Subject: [PATCH] Add PHPSTAN --- lint/lint.yml | 3 +++ lint/phpstan.yml | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 lint/phpstan.yml diff --git a/lint/lint.yml b/lint/lint.yml index 56fb7df..61f2966 100644 --- a/lint/lint.yml +++ b/lint/lint.yml @@ -2,6 +2,9 @@ include: - project: 'ldc-web/shared-ci' ref: 'main' file: 'lint/phpcs.yml' + - project: 'ldc-web/shared-ci' + ref: 'main' + file: 'lint/phpstan.yml' - project: 'ldc-web/shared-ci' ref: 'main' file: 'lint/eslint.yml' diff --git a/lint/phpstan.yml b/lint/phpstan.yml new file mode 100644 index 0000000..26b8caf --- /dev/null +++ b/lint/phpstan.yml @@ -0,0 +1,18 @@ +phpstan: + stage: lint + image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/ldcweb-qa-8.2:latest + before_script: + - composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD + - composer install --no-scripts + script: + - vendor/bin/phpstan --error-format=junit > phpstan-report.xml + artifacts: + when: on_failure + expose_as: 'phpstan' + paths: + - phpstan-report.xml + reports: + junit: phpstan-report.xml + allow_failure: true + rules: + - if: $CI_PIPELINE_SOURCE == "merge_request_event"