image: "python:3.10"

before_script:  # Docker provisionning (required for for every job).
  - apt-get update -qy
  - apt install -y libgl1-mesa-glx
  - pip install uv

workflow:
  rules:
    - if: $CI_MERGE_REQUEST_ID  # Avoid dublicated jobs on merge commits
      when: never
    - when: always

stages: [test, deploy]

test_stage:
  stage: test
  script:
    - uv sync
    - uv run pytest

deploy_stage:
  stage: deploy
  rules:
    - if: '$CI_COMMIT_TAG'
  script:
    - uv build
    - uv tool run twine upload dist/*

