From e951b5a2c243553fe62cdacaa324afe04b5aad92 Mon Sep 17 00:00:00 2001 From: Abdel LAMRANI Date: Mon, 3 Aug 2026 10:40:56 +0200 Subject: [PATCH] config rector for CI --- lint/lint.yml | 13 +++++++++++++ lint/rector.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 lint/rector.yml diff --git a/lint/lint.yml b/lint/lint.yml index 61f2966..ed41356 100644 --- a/lint/lint.yml +++ b/lint/lint.yml @@ -1,3 +1,11 @@ +spec: + inputs: + enable_rector: + default: false + type: boolean + +--- + include: - project: 'ldc-web/shared-ci' ref: 'main' @@ -5,6 +13,11 @@ include: - project: 'ldc-web/shared-ci' ref: 'main' file: 'lint/phpstan.yml' + - project: "ldc-web/shared-ci" + ref: "main" + file: "lint/rector.yml" + inputs: + enable_rector: $[[ inputs.enable_rector ]] - project: 'ldc-web/shared-ci' ref: 'main' file: 'lint/eslint.yml' diff --git a/lint/rector.yml b/lint/rector.yml new file mode 100644 index 0000000..7de98f2 --- /dev/null +++ b/lint/rector.yml @@ -0,0 +1,30 @@ +spec: + inputs: + enable_rector: + default: false + type: boolean + +--- + +rector: + stage: lint + image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/uwil-qa-8.5:latest + cache: + key: rector-cache-$CI_COMMIT_REF_SLUG + paths: + - .rector-cache/ + before_script: + - composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD + - composer install --no-scripts + script: + - vendor/bin/rector process --dry-run --no-progress-bar --output-format=junit > rector-report.xml + artifacts: + when: always + expose_as: 'rector' + paths: + - rector-report.xml + reports: + junit: rector-report.xml + allow_failure: true + rules: + - if: '$CI_PIPELINE_SOURCE == "merge_request_event" && "$[[ inputs.enable_rector ]]" == "true"' \ No newline at end of file