image: continuumio/miniconda3:latest

variables:
  CONDA_PKGS_DIRS: "${CI_PROJECT_DIR}/conda/pkgs"
  GIT_SUBMODULE_STRATEGY: recursive

cache:
  paths:
    - $CONDA_PKGS_DIRS

before_script:
  - apt-get update -y && apt-get -y install libgl1-mesa-glx 
  - mkdir -p /usr/share/man/man1mkdir -p /usr/share/man/man1
  - apt-get -y install -f openjdk-11-jre-headless texlive-latex-extra dvipng cm-super
  - conda env create -f environment.yml
  - source activate resultsanalysis
  - conda install -c conda-forge phasexmlparser phasexmlcreator resultsanalysis puresolventinformation
  - ls
  - cd ../
  - if [[ -d 'solventmapcreator' ]]; then rm -r solventmapcreator; fi
  - git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.developers.cam.ac.uk/ch/hunter/ssiptools/ssimpleapps/solventmapcreator.git
  - cd solventmapcreator
  - pip install . --no-deps
  - cd ../phasecalculator
  - pip install . --no-deps


unittest:
  script:
    - pytest --pyargs phasecalculator
