cache:
  key: "project-${CI_JOB_NAME}"
  paths:
    - .torch-home
  # cache installs from previous tests

stages:
  - test

unit-test-job:
  stage: test
  image: mmp-img-test  # in the test environment, no CUDA is available
  before_script:
    - export TORCH_HOME="$CI_PROJECT_DIR/.torch-home"
  script:
    - pytest tests/ --junitxml=report.xml  # export in junit format for GitLab
  # generate a report on GitLab
  artifacts:
    when: always
    reports:
      junit: report.xml
