ldc-shared-ci/lint/phpstan.yml
2026-08-21 12:37:08 +02:00

49 lines
1.3 KiB
YAML

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: composer:2.10
cache:
key: phpstan-cache-${CI_COMMIT_REF_SLUG}
paths:
- vendor/
- .phpstan-cache/
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 --no-interaction
- |
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:
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"