stages:
- build
- test-jobs
- test-tasks

image: python:3.11-bullseye

variables:
  PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"

cache:
  paths:
    - .cache/pip

build-env:
  stage: build
  script:
    - pip install poetry
    - cd build/
    - poetry install --no-root
  
test-jobs:
  stage: test-jobs
  script:
    - source $(poetry env info --path)/bin/activate
    - pytest jobs/tests/

test-tasks:
  stage: test-tasks
  script:
    - source $(poetry env info --path)/bin/activate
    - pytest tasks/tests/