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

image: python:3.11-bullseye

cache:
  paths:
    - .venv
  key: "${CI_COMMIT_REF_SLUG}"

build-env:
  stage: build
  script:
    - pip install poetry
    - cd build/
    - poetry config settings.virtualenvs.in-project true
    - poetry install
    - cd ..
  
test-jobs:
  stage: test-jobs
  script:
    - poetry run pytest jobs/tests/

test-tasks:
  stage: test-tasks
  script:
    - poetry run pytest tasks/tests/