Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.59 KiB
# This file is a template, and might need editing before it works on your project.
# This file is a template, and might need editing before it works on your project.
image: python:latest

stages:
  - pretest
  - build
  - test
  - coverage
  - doc_build
  - deploy

ssh:
  stage: pretest:
  before_script:
  - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
  - 'which rsync || apt-get install rsync -y'
  - eval $(ssh-agent -s)
  - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
  - mkdir -p ~/.ssh
  - chmod 700 ~/.ssh
  - echo "$SSH_PRIVATE_KEY" > ~/.ssh/gitlab_rsa
  - echo "$SSH_PUBLIC_KEY" > ~/.ssh/gitlab_rsa.pub
  
    
  script:
  - ssh -p50022 bolirev@bioneuro77.biologie.uni-bielefeld.de "mkdir -p /fastdata/html/navipy/"

navipy_install:
  stage: build
  before_script:
  - python3 -V # Print out python version for debugging

  script:
  - pip3 install virtualenv
  - virtualenv venv
  - source venv/bin/activate
  - python3 setup.py bdist_wheel

  artifacts:
    paths:
      - venv

flake8:
  stage: test
  dependencies:
  - navipy_install

  script:
  - source $CI_PROJECT_DIR/venv/bin/activate
  - python3 -m flake8 navipy/*.py
  
navipy_unittest:
  stage: test
  dependencies: 
  - navipy_install

  script:
  - source $CI_PROJECT_DIR/venv/bin/activate
  - python3 -m coverage run -m unittest discover navipy

  artifacts:
    paths:
      - .coverage

coverage:
  stage: coverage
  dependencies: 
  - navipy_install
  - navipy_unittest