image: python:latest

workflow:
  rules:
    - if: $CI_COMMIT_BRANCH

pages:
  stage: deploy
  script:
    - python3 -m venv .venv
    - source .venv/bin/activate
    - pip install --upgrade numpy pdoc3
    - pdoc --html ammosreader -o public
    - mv public/ammosreader public/doc
  artifacts:
    paths:
    - public/doc
  rules:
    - if: $CI_COMMIT_BRANCH == "guix"

pytest:
  stage: test
  script:
    - cd tests
    - pip install -U pytest 
    - pytest --junitxml=report.xml
  artifacts:
    when: always
    reports:
      junit: tests/report.xml
  rules:
    - if: $CI_COMMIT_BRANCH == "guix"
