Merge branch 'develop' into 'main'

Develop

See merge request ldc-web/shared-ci!25
This commit is contained in:
Vincent BRIDIER 2026-08-03 11:48:36 +02:00
commit 2bf7556e36
3 changed files with 86 additions and 0 deletions

View file

@ -1,3 +1,22 @@
spec:
inputs:
larastan_bootstrap:
default: false
type: boolean
db_connection:
default: "sqlite"
db_database:
default: ":memory:"
cache_store:
default: "array"
session_driver:
default: "array"
enable_rector:
default: false
type: boolean
---
include:
- project: 'ldc-web/shared-ci'
ref: 'main'
@ -5,6 +24,17 @@ include:
- project: 'ldc-web/shared-ci'
ref: 'main'
file: 'lint/phpstan.yml'
inputs:
larastan_bootstrap: $[[ inputs.larastan_bootstrap ]]
db_connection: $[[ inputs.db_connection ]]
db_database: $[[ inputs.db_database ]]
cache_store: $[[ inputs.cache_store ]]
session_driver: $[[ inputs.session_driver ]]
- 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'

View file

@ -1,9 +1,35 @@
spec:
inputs:
larastan_bootstrap:
default: false
type: boolean
db_connection:
default: "sqlite"
db_database:
default: ":memory:"
cache_store:
default: "array"
session_driver:
default: "array"
---
phpstan:
stage: lint
image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/uwil-qa-8.5:latest
variables:
DB_CONNECTION: "$[[ inputs.db_connection ]]"
DB_DATABASE: "$[[ inputs.db_database ]]"
CACHE_STORE: "$[[ inputs.cache_store ]]"
SESSION_DRIVER: "$[[ inputs.session_driver ]]"
before_script:
- composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
- composer install --no-scripts
- |
if [ "$[[ inputs.larastan_bootstrap ]]" = "true" ]; then
cp .env.example .env
php artisan key:generate
fi
script:
- vendor/bin/phpstan --error-format=junit > phpstan-report.xml
artifacts:

30
lint/rector.yml Normal file
View file

@ -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"'