Compare commits

...
Sign in to create a new pull request.

15 commits

Author SHA1 Message Date
Vincent BRIDIER
4d19fa9b7f Merge branch 'develop' into 'main'
feat: Add PHP 8.5 TAG VAR

See merge request ldc-web/shared-ci!29
2026-08-24 12:49:00 +02:00
Vincent BRIDIER
e071a603f6 feat: Add PHP 8.5 TAG VAR 2026-08-24 12:48:47 +02:00
Vincent BRIDIER
fedde1e0a8 Merge branch 'develop' into 'main'
Tmp disable kaniko cache

See merge request ldc-web/shared-ci!28
2026-08-21 16:19:20 +02:00
Vincent BRIDIER
fa814e8d55 Tmp disable kaniko cache 2026-08-21 16:19:05 +02:00
Vincent BRIDIER
6606eb89e7 Merge branch 'develop' into 'main'
feat: Add gitlab token for composer audit

See merge request ldc-web/shared-ci!27
2026-08-21 15:21:01 +02:00
Vincent BRIDIER
b9c76afa6d feat: Add gitlab token for composer audit 2026-08-21 15:19:30 +02:00
Vincent BRIDIER
a75ff7e880 Merge branch 'develop' into 'main'
Develop

See merge request ldc-web/shared-ci!26
2026-08-21 12:37:47 +02:00
Vincent BRIDIER
8adc82419f feat: Remove 8.5 QA Image deps 2026-08-21 12:37:08 +02:00
Vincent BRIDIER
494539a2e3 Merge branch 'develop' of lab.s-web.fr:ldc-web/shared-ci into develop 2026-08-21 11:40:22 +02:00
Vincent BRIDIER
2bf7556e36 Merge branch 'develop' into 'main'
Develop

See merge request ldc-web/shared-ci!25
2026-08-03 11:48:36 +02:00
Vincent BRIDIER
9742e761c6 Merge branch 'addRector-new' into 'develop'
config rector for CI

See merge request ldc-web/shared-ci!24
2026-08-03 11:48:19 +02:00
Abdel LAMRANI
396d5761db Merge branch 'develop' of lab.s-web.fr:ldc-web/shared-ci into addRector-new 2026-08-03 11:34:57 +02:00
Vincent BRIDIER
bdfdf9e5e7 Merge branch 'customRef' into 'develop'
add params for phpStan

See merge request ldc-web/shared-ci!22
2026-08-03 11:21:53 +02:00
Abdel LAMRANI
384b4da9ad feat: make Larastan bootstrap for phpstan and configurable via inputs 2026-08-03 11:08:11 +02:00
Abdel LAMRANI
e951b5a2c2 config rector for CI 2026-08-03 11:01:31 +02:00
8 changed files with 114 additions and 15 deletions

View file

@ -1,23 +1,27 @@
composer-build:
stage: build
image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/uwil-qa-8.5:latest
before_script:
- composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
image: composer:2.10
cache:
key:
files:
- composer.lock
paths:
- vendor/
policy: pull-push
before_script:
- composer config gitlab-token.lab.s-web.fr "${CI_DEPLOY_USER}" "${CI_DEPLOY_PASSWORD}"
script:
- composer install --no-dev --optimize-autoloader --classmap-authoritative --no-scripts
- composer install --ignore-platform-reqs --no-interaction --no-plugins --no-scripts --no-dev --prefer-dist
artifacts:
expose_as: 'vendor'
paths:
- vendor
allow_failure: false
paths:
- vendor/
expire_in: 1h
dependencies:
- composer-security
needs:
- job: composer-security
optional: true
allow_failure: false
rules:
- if: $CI_COMMIT_BRANCH == "trunk" || $CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "main"
- if: $CI_COMMIT_TAG != null
- if: $CI_COMMIT_TAG != null

View file

@ -8,6 +8,7 @@
--context "${CI_PROJECT_DIR}"
--build-arg "GITLAB_USER=${CI_DEPLOY_USER}"
--build-arg "GITLAB_PASSWORD=${CI_DEPLOY_PASSWORD}"
--build-arg "PHP_8_5_TAG=${PHP_8_5_TAG}"
--dockerfile "${CI_PROJECT_DIR}/Dockerfile"
--destination "${IMAGE_TAG}"
--cache=true

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,6 +1,6 @@
phpcs:
stage: lint
image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/uwil-qa-8.5:latest
image: composer:2.10
before_script:
- composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
- composer install --no-scripts

View file

@ -1,9 +1,40 @@
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
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
- 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:

31
lint/rector.yml Normal file
View file

@ -0,0 +1,31 @@
spec:
inputs:
enable_rector:
default: false
type: boolean
---
rector:
stage: lint
image: composer:2.10
cache:
key: rector-cache-$CI_COMMIT_REF_SLUG
paths:
- vendor/
- .rector-cache/
before_script:
- composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
- composer install --no-scripts --no-interaction
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"'

View file

@ -1,8 +1,10 @@
composer-security:
stage: security
image: $CI_REGISTRY/ldc-web/projets/ldc-web-images-docker/uwil-qa-8.5:latest
image: composer:2.10
before_script:
- composer config gitlab-token.lab.s-web.fr $CI_DEPLOY_USER $CI_DEPLOY_PASSWORD
script:
- local-php-security-checker --format=json --path=./composer.lock > composer-security-checker-report.json
- composer audit --locked --format=json > composer-security-checker-report.json || true
artifacts:
when: on_failure
expose_as: 'composer-security-checker'

View file

@ -1,6 +1,6 @@
npm-security:
stage: security
image: node:17.9.1
image: node:24
before_script:
- npm install --location=global audit-ci@^6
script: