stages:
  - tests

image: php:8.3

services:
  - mysql:5.7

variables:
  # Configure mysql environment variables (https://hub.docker.com/r/_/mysql/)
  MYSQL_USER: 'suresnes'
  MYSQL_PASSWORD: 'suresnes_strong_password'
  MYSQL_DATABASE: 'suresnes'
  MYSQL_RANDOM_ROOT_PASSWORD: 'yes'

before_script:
  - apt-get update -yqq
  - apt-get install -yqq git zlib1g-dev unzip libicu-dev
  - docker-php-ext-install pdo pdo_mysql intl
  - curl -sL https://raw.githubusercontent.com/axllent/mailpit/develop/install.sh | bash
  - curl -sS https://getcomposer.org/installer | php
  - cp -p config/parameters.gitlab.yaml.dist config/parameters.yaml
  - cp -p config/parameters.gitlab.yaml.dist config/parameters_test.yaml
  - SYMFONY_ENV=prod php composer.phar install

  - mailpit -l 127.0.0.1:1080 &
  - php bin/console --env=test doctrine:schema:update --force --no-interaction --no-debug

Behat tests:
  stage: tests
  script:
    php ./bin/behat
