Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.32 KiB
Newer Older
  • Learn to ignore specific revisions
  • Olivier Bertrand's avatar
    Olivier Bertrand committed
    image: python:latest
    
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
    stages:
      - build
      - test
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      - coverage
      - doc_build
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
    
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
    navipy_install:
      stage: build
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      before_script:
      - python3 -V # Print out python version for debugging
    
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      script:
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      - pip3 install virtualenv
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      - virtualenv -p python3 venv
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      - source venv/bin/activate
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      - pip3 install .
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      - python navipy/scripts/config_matplotlib_server.py # because no interactive backend
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
    
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      artifacts:
        paths:
          - venv
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
    
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      stage: test
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      dependencies:
      - navipy_install
    
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      script:
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      - source $CI_PROJECT_DIR/venv/bin/activate
    
      - python3 -m flake8 navipy/*.py
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
    navipy_unittest:
      stage: test
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      dependencies: 
      - navipy_install
    
      script:
      - source $CI_PROJECT_DIR/venv/bin/activate
      - python3 -m coverage run -m unittest discover navipy
    
      artifacts:
        paths:
          - .coverage
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
    
    coverage:
      stage: coverage
      dependencies: 
      - navipy_install
      - navipy_unittest
      
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      - source $CI_PROJECT_DIR/venv/bin/activate
      - python3 -m coverage html
    
      artifacts:
        paths:
          - coverage_html_report
        expire_in: 1 day
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
    doc_build:
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      stage: doc_build
      dependencies:
      - navipy_install
      - coverage
    
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      script:
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      - source $CI_PROJECT_DIR/venv/bin/activate
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      - cd doc ; make html
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
    
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
      artifacts:
        paths:
    
    Olivier Bertrand's avatar
    Olivier Bertrand committed
        expire_in: 1 week