stages:
 - install
 - test

.junit_template: &junit_definition
    artifacts:
      reports:
        junit: "junit*.xml"


install_py37:
  stage: install
  image: python:3.7-buster
  script:
    - apt-get -y update
    - python setup.py install
    - eossr-codemeta2zenodo --help
    - eossr-codemeta2zenodo --input_codemeta_file ./codemeta.json
    - cat .zenodo.json
    - echo "testing all entry points and bash scripts"
    - eossr-upload-new-deposit -h
    - eossr-upload-new-version-deposit -h
    - eossr-check-connection-zenodo -h
    - which parse_last_release_git.sh
  only:
    - branches

test_py37:
    stage: test
    image: python:3.7-buster
    script:
      - apt-get -y update
      - pip install pytest pytest-cov
      - pip install -e .
      - pytest eossr/
        --junitxml=junit_py37.xml
        --color=yes
        --verbose
        --cov=eossr
        --cov-report=xml
        --cov-report=term
    <<: *junit_definition
