# Pick zero or more services to be used on all builds.
# Only needed when using a docker container to run your tests in.
# Check out: https://docs.gitlab.com/ce/ci/docker/using_docker_images.html#what-is-service

# services:
#   - mysql:latest
#   - redis:latest
#   - postgres:latest

# variables:
#   POSTGRES_DB: database_name

# Cache packages in between builds
cache:
  paths:
    - vendor/python

# This is a basic example for a packages or script which doesn't use
# services such as redis or postgres
before_script:
  - python --version      # Print out Python version for debugging
  # Setup git
  - apt-get install git
  - git config --global user.email "ci@cortext.net"
  - git config --global user.name "CorTexT Continuos Integration"
  # Install dependencies for the testing environment
  - pip install -U pip setuptools
  - pip install -U tox

.test_script: &test_script
  script:
    - tox

# Run in different environments
py39:
  image: "python:3.9"
  <<: *test_script

py311:
  image: "python:3.11"
  <<: *test_script

#docs:
  #script:
    #- tox -e docs

# This deploy job uses a simple deploy flow to Heroku, other providers, e.g. AWS Elastic Beanstalk
# are supported too: https://github.com/travis-ci/dpl
#deploy:
#  type: deploy
#  environment: production
#  script:
#    - python setup.py
#    - dpl --provider=heroku --app=$HEROKU_APP_NAME --api-key=$HEROKU_PRODUCTION_KEY
