lucasmiranda42/deepof

View on GitHub
.gitlab-ci.yml

Summary

Maintainability
Test Coverage
stages:
  - install
  - test
  - tutorials

install-pypi:

  stage: install
  retry: 1

  image:
    name: python:3.9.14

  script:
    - apt-get update && apt-get install ffmpeg libsm6 libxext6  -y
    - pip install deepof
    - python -c 'import deepof.data'

install-poetry:

  stage: install
  retry: 1

  image:
    name: python:3.9.14

  script:
    - apt-get update && apt-get install ffmpeg libsm6 libxext6  -y
    - curl -sSL https://install.python-poetry.org | python3 -
    - export PATH="/root/.local/bin:$PATH"
    - poetry install
    - poetry run python -c 'import deepof.data'

test:
  stage: test
  retry: 1

  image:
    name: lucasmiranda42/deepof
    entrypoint: [""]

  before_script:
    - export PATH="~/.local/pipx/venvs/poetry/bin:$PATH"

  script:
    - coverage run --source deepof -m pytest
    - coverage report -m --include deepof/post_hoc.py,deepof/data.py,deepof/utils.py,deepof/model_utils.py,deepof/annotation_utils.py,deepof/models.py,deepof/hypermodels.py,deepof/visuals_utils.py
    - coverage xml -o deepof_cov.xml

  coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'

  artifacts:
    reports:
      coverage_report:
        coverage_format: cobertura
        path: deepof_cov.xml

tutorials:
  stage: tutorials

  artifacts:
    expose_as: 'tutorials_report'
    paths:
      - deepof_preprocessing_tutorial.ipynb
      - deepof_supervised_tutorial.ipynb
      - deepof_unsupervised_tutorial.ipynb
      - deepof_custom_labels_tutorial.ipynb

  image:
    name: lucasmiranda42/deepof
    entrypoint: [ "" ]

  before_script:
    - apt update
    - apt install -y curl unzip
    - pip install papermill
    - pip install -q -e . --progress-bar off
    - python -m ipykernel install --user --name deepof --display-name "Python (deepof)"
    - curl --output tutorial_files.zip https://datashare.mpcdf.mpg.de/s/QoawozFfT53JfPW/download
    - unzip tutorial_files.zip

  script:
    - pip install natsort
    - papermill docs/source/tutorial_notebooks/deepof_preprocessing_tutorial.ipynb preprocessing_output.ipynb
    - papermill docs/source/tutorial_notebooks/deepof_supervised_tutorial.ipynb supervised_output.ipynb
    - papermill docs/source/tutorial_notebooks/deepof_unsupervised_tutorial.ipynb unsupervised_output.ipynb
    - papermill docs/source/tutorial_notebooks/deepof_custom_labels_tutorial.ipynb custom_labels_output.ipynb