image: python:3.9

services:
  - mysql:5.7

variables:
  MYSQL_DATABASE: "test"
  MYSQL_ROOT_PASSWORD: "mysql"
  MYSQL_USER: "django"
  MYSQL_PASSWORD: "mysql"
  MYSQL_HOST: "mysql"

cache:
  paths:
    - ~/.cache/pip/

before_script:
  - python -V  # Print out python version for debugging
  - apt-get -qq update
  - apt-get -qq install -y python3-virtualenv python3 python3-dev python3-pip gettext default-libmysqlclient-dev
  - export DJANGO_SETTINGS_MODULE=AKPlanning.settings_ci
  - ./Utils/setup.sh --prod

test:
  script:
    - source venv/bin/activate
    - python manage.py test --settings AKPlanning.settings_ci --keepdb
