variables:
  GIT_SUBMODULE_STRATEGY: recursive
  KWANT_QSYMM_TEST_PATH_SCRIPT: >
    import os;
    import kwant.tests.test_qsymm;
    print(os.path.abspath(kwant.tests.test_qsymm.__file__));

image: gitlab.kwant-project.org:5005/qt/research-docker

## Documentation for the format of this file can be found here:
## https://docs.gitlab.com/ce/ci/yaml/README.html#configuration-of-your-builds-with-gitlab-ci-yml

test minimal requirements:
  script:
    - mamba env create -f environment-minimal.yml
    - source activate qsymm-minimal
    - py.test qsymm/ --cov=qsymm --verbose --cov-report term
  stage: test

test latest requirements:
  script:
    - mamba env create -f environment-latest.yml
    - source activate qsymm-latest
    - py.test qsymm/ --cov=qsymm --verbose --cov-report term
  stage: test

test kwant against latest qsymm:
  script:
    - mamba env create -f environment-latest.yml
    - source activate qsymm-latest
    # Get bleeding-edge Kwant
    - mamba install cython
    - pip install .  # need to install qsymm so that the kwant test can find it
    - pip install git+https://gitlab.kwant-project.org/kwant/kwant.git@stable
    - export KWANT_QSYMM_PATH=$(python -c "$KWANT_QSYMM_TEST_PATH_SCRIPT")
    - py.test $KWANT_QSYMM_PATH
  stage: test
