image: python:3.10

stages:
  - dependencies
  - lint
  - test

download_dependencies:
  stage: dependencies
  before_script:
    - python -m venv .venv
    - source .venv/bin/activate
  script:
    - pip install -r requirements.txt
  artifacts:
    paths:
      - .venv

pylint:
  stage: lint
  dependencies:
    - download_dependencies
  needs:
    - download_dependencies
  script:
    - source .venv/bin/activate
    - pip install pylint
    - pylint calculator --fail-on=error

# À toi de nous rajouter un petit job pour faire des tests unitaires
pytest:
  stage: test
  dependencies:
    - download_dependencies
  needs:
    - download_dependencies
  script:
    - source .venv/bin/activate
    - pip install pytest
    - pytest calculator
