ci : add pull_request quality gate workflow
Some checks failed
Pull Request — Quality gate / Backend (PHP CS + PHPUnit) (pull_request) Failing after 13s
Pull Request — Quality gate / Frontend (lint + Vitest + build) (pull_request) Successful in 10m18s

Workflow Gitea declenche sur chaque PR ciblant develop, avec deux jobs
paralleles :
- backend : composer install, php-cs-fixer dry-run, bootstrap DB test
  (service postgres:16-alpine), phpunit
- frontend : npm ci, eslint, vitest, nuxt build

Ajoute aussi la cible make php-cs-fixer-check (dry-run) pour avoir la
meme commande en local et en CI.

E2E volontairement hors scope (regle d'or testing.md : tests E2E
uniquement pour bug critique passe en prod).
This commit is contained in:
Matthieu
2026-05-19 15:16:51 +02:00
parent 1696602abb
commit 2aecab0a5f
2 changed files with 124 additions and 0 deletions

View File

@@ -70,6 +70,7 @@ help:
@printf " \033[36m%-28s\033[0m %s\n" "install-e2e-deps" "One-time : Chromium + libs systeme (sudo)"
@printf "\n \033[1;33mQualite code\033[0m\n"
@printf " \033[36m%-28s\033[0m %s\n" "php-cs-fixer-allow-risky" "Fix code style PHP (utilise par le pre-commit)"
@printf " \033[36m%-28s\033[0m %s\n" "php-cs-fixer-check" "Dry-run du fixer (CI / verif avant push)"
@printf "\n Plus de details : \033[4mREADME.md\033[0m, \033[4mCLAUDE.md\033[0m\n\n"
env-init:
@@ -258,6 +259,11 @@ php-cs-fixer-allow-risky:
@echo "Fixing files: $(FILES)"
$(EXEC_PHP_CS_FIXER) fix --config=.php-cs-fixer.dist.php --allow-risky=yes $(FILES)
# Dry-run du fixer : echec si au moins un fichier n'est pas conforme.
# Utilise par la CI (Gitea pull_request) et avant un push manuel.
php-cs-fixer-check:
$(EXEC_PHP_CS_FIXER) fix --config=.php-cs-fixer.dist.php --allow-risky=yes --dry-run --diff $(FILES)
test:
$(EXEC_PHP) php -d memory_limit="512M" vendor/bin/phpunit $(FILES)