update tasks

This commit is contained in:
Matthieu Lamalle 2024-01-30 12:52:38 +01:00
parent 2c186f813c
commit affa99c877
3 changed files with 21 additions and 2 deletions

View File

@ -12,6 +12,9 @@ spec:
- name: revision - name: revision
type: string type: string
description: The git repo branch to checkout. description: The git repo branch to checkout.
- name: destination
type: string
description: The git repo branch to merge to.
- name: image - name: image
type: string type: string
description: Full name of image repo. description: Full name of image repo.
@ -40,6 +43,9 @@ spec:
value: $(params.revision) value: $(params.revision)
- name: submodules - name: submodules
value: 'false' value: 'false'
- name: depth
value: '50'
# Lecture du readme du projet # Lecture du readme du projet
- name: show-readme - name: show-readme
runAfter: ["fetch-source"] runAfter: ["fetch-source"]
@ -74,6 +80,9 @@ spec:
workspace: shared-data workspace: shared-data
- name: config - name: config
workspace: config workspace: config
params:
- name: destination
value: $(params.destination)
# Execution des tests unitaires avec une BDD en sidecar # Execution des tests unitaires avec une BDD en sidecar
- name: php-unit-test - name: php-unit-test

View File

@ -7,6 +7,9 @@ spec:
workspaces: workspaces:
- name: source - name: source
- name: config - name: config
params:
- name: destination
default: develop
steps: steps:
- name: exec - name: exec
image: ghcr.io/php-cs-fixer/php-cs-fixer:3-php8.3 image: ghcr.io/php-cs-fixer/php-cs-fixer:3-php8.3
@ -16,4 +19,10 @@ spec:
- '-c' - '-c'
- | - |
set -ex set -ex
php-cs-fixer fix --dry-run --config=$(workspaces.config.path)/php-cs-fixer.dist.php $(workspaces.source.path) apk add git
cd $(workspaces.source.path)
git config --global --add safe.directory /workspace/source
git fetch origin $(params.destination)
CHANGED_FILES=$(git diff --name-only --diff-filter=ACMRTUXB origin/$(params.destination) -- | grep -F ".php" | tr "\n" " ")
if ! echo "${CHANGED_FILES}" | grep -qE "^(\\.php-cs-fixer(\\.dist)\\.php?|composer\\.lock)$"; then EXTRA_ARGS=$(printf -- '--path-mode=intersection -- %s' "${CHANGED_FILES}"); else EXTRA_ARGS=''; fi
php-cs-fixer fix --dry-run --config=$(workspaces.config.path)/php-cs-fixer.dist.php ${EXTRA_ARGS}

View File

@ -23,6 +23,7 @@ spec:
- /app/vendor/phpstan/phpstan-doctrine/extension.neon - /app/vendor/phpstan/phpstan-doctrine/extension.neon
- /app/vendor/phpstan/phpstan-doctrine/rules.neon - /app/vendor/phpstan/phpstan-doctrine/rules.neon
EOF EOF
phpstan analyse -l 1 --error-format=table $(workspaces.source.path) cd $(workspaces.source.path)
php $(which phpstan) analyse -l 1 --error-format=table src/