Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.24 KiB
Newer Older
image: python

    - pip3 install black 'pylint<3' 'isort[colors]<6'
    - pip3 install --editable .
    - black --check --diff --color .
    - isort --check --diff --color .
    - pylint src/finam

test:
  stage: test
  script:
    - pip3 install --editable .[test]
Sebastian Müller's avatar
Sebastian Müller committed
    - python -m pytest --cov finam --cov-report html:cov --cov-report term-missing --cov-report xml:cov.xml -v tests/
  coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/'
  artifacts:
    reports:
      coverage_report:
        coverage_format: cobertura
        path: cov.xml
Sebastian Müller's avatar
Sebastian Müller committed
    paths:
      - cov
Martin Lange's avatar
Martin Lange committed
doctest:
  stage: test
Martin Lange's avatar
Martin Lange committed
  script:
    - pip3 install --editable .[doc]
    # doctest does not detect tests in code files during the first run.
    # add a dummy build to generate .rst files before the actual tests
    - sphinx-build -b dummy docs/source docs/build
Martin Lange's avatar
Martin Lange committed
    - sphinx-build -b doctest docs/source docs/build

    - pip3 install --editable .[doc]
Sebastian Müller's avatar
Sebastian Müller committed
    - sphinx-build docs/source docs/build
    - mv docs/build public/
  artifacts:
    paths:
      - public

pages:
  stage: deploy
  script: "true"
  artifacts:
    paths:
      - public
  only:
    - main