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:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -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/
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user