server-setup:
  image: python
  stage: setup
  artifacts:
    paths:
      - server/env
    expire_in: 15 min
    untracked: true
  cache:
    key: "$CI_COMMIT_REF_SLUG"
    paths:
      - server/env
  script:
    - python --version
    - pip install virtualenv
    - cd server/
    - python -m venv env
    - source env/bin/activate
    - pip install -r requirements.txt

server-test:
  image: python
  stage: test
  dependencies:
    - server-setup
  script:
    - cd server
    - source env/bin/activate
    - pytest --cov app tests/
