feat(ci): Améliore configuration CI/CD

Ajoute variables d'environnement et crée base de données pour tests.
Ajuste .gitignore pour fichiers d'environnement.
This commit is contained in:
Serreau Jovann
2025-07-16 16:55:59 +02:00
parent 1880151543
commit 11447f3f54
2 changed files with 5 additions and 5 deletions

4
.gitignore vendored
View File

@@ -1,9 +1,7 @@
###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/.env.*.test
/.env.test
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/

View File

@@ -21,6 +21,7 @@ services:
before_script:
- echo "Starting environment setup..."
- echo "Creating .env.local file..."
- echo "APP_ENV=test" > .env.local
- echo "APP_ENV=test" > .env.test
- echo "KERNEL_CLASS=App\Kernel" > .env.test
- echo "APP_SECRET='$ecretf0rt3st'" > .env.test
@@ -49,8 +50,9 @@ run_tests:
XDEBUG_MODE: coverage
script:
- echo "Starting testing stage..."
- php bin/console doctrine:migrations:migrate --env=test
- vendor/bin/phpunit -c phpunit.dist.xml --env=test
- php bin/console doctrine:database:create
- php bin/console -no-interaction doctrine:migrations:migrate
- vendor/bin/phpunit -c phpunit.dist.xml
- echo "Tests completed successfully."
needs:
- job: install_dependencies # Ce job dépend du job 'install_dependencies'