Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.51 KiB
Newer Older
image: "continuumio/miniconda3"
Jan Caron's avatar
Jan Caron committed

before_script:
  # Check and print Python version
Jan Caron's avatar
Jan Caron committed
  - python --version
  # Create SSH configuration directory if necessary (also parents with -p, mode: read/write/exec):
  - mkdir -p --mode=700 ~/.ssh/
  # Add SSH key for jutil:
  - echo "$ID_RSA_JUTIL_PRIVATE" > ~/.ssh/id_rsa_jutil
  # Provide read access to owner (octal value code: 400) to jutil key and known_hosts with chmod:
  - chmod 400 ~/.ssh/id_rsa_jutil
  # Configure SSH to use ~/.ssh/jutil_key for iffgit.fz-juelich.de (-e allows \n):
  - echo -e "Host iffgit.fz-juelich.de\n\tIdentityFile ~/.ssh/id_rsa_jutil\n" > ~/.ssh/config
  # Add iffgit.fz-juelich.de to known_hosts (not the same key as Jutil!):
  - echo iffgit.fz-juelich.de,134.94.161.83 "$ID_RSA_IFFGIT_PUBLIC" > ~/.ssh/known_hosts
  # Provide read access to owner (octal value code: 400) to known_hosts with chmod:
  - chmod 400 ~/.ssh/known_hosts
Jan Caron's avatar
Jan Caron committed
stages:
  - test

Jan Caron's avatar
Jan Caron committed
  stage: test
  script:
    # TODO: Different jobs with custom develop arguments? extra_requires (hyperspy, plotting)?
    # TODO: Use pip install -e .[hyperspy], etc.
#    # - pip install -r requirements.txt  # TODO: DOES NOT WORK (because mayavi and stuff...)
    - pip install -e .['tests']
    # Install jutil via secure ssh connection:
    - pip install git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git
    # Execute tests:
Jan Caron's avatar
Jan Caron committed
    - python setup.py test
Jan Caron's avatar
Jan Caron committed
    - coverage html
  artifacts:
    paths:
      - htmlcov/

test_pip_full:
  stage: test
  script:
    # Install requirements:
    - pip install -e .['all']
    # Install jutil via secure ssh connection:
    - pip install git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git
    # Execute tests:
    - python setup.py test

test_pip_requirements:
  stage: test
  script:
    - pip install numpy  # Needed for mayavi...
    # Install requirements:
    - pip install -r requirements.txt  # TODO: DOES NOT WORK (because mayavi and stuff...)
    # Install jutil via secure ssh connection:
    - pip install git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git
    # Execute tests:
    - python setup.py test

test_conda:
  stage: test
  script:
    # Install requirements:
    - conda info --envs
    - conda env create -q  # -q: quiet/ no progressbar, because it spams the log!
    - source activate pyramid
    - conda info --envs
    # Install jutil via secure ssh connection:
    - pip install git+ssh://gitlab@iffgit.fz-juelich.de/unger/jutil.git
    # Execute tests:
    - python setup.py test