Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.77 KiB
Newer Older
# SPDX-FileCopyrightText: 2021 Helmholtz-Zentrum für Umweltforschung GmbH - UFZ
#
# SPDX-License-Identifier: GPL-3.0-or-later

# ===========================================================
# preparation
# ===========================================================

variables:
  GIT_SUBMODULE_STRATEGY: recursive

Bert Palm's avatar
Bert Palm committed
default:
  image: python:3.8
  before_script:
    - pip install --upgrade pip
    - pip install pytest
    - pip install -r requirements.txt
Bert Palm's avatar
Bert Palm committed


# ===========================================================
# normal jobs (non scheduled)
# ===========================================================
Bert Palm's avatar
Bert Palm committed

# test saqc with python 3.7
python37:
  stage: test
  image: python:3.7
    - pytest tests/core tests/funcs tests/integration dios/test -Werror
Norman Ziegner's avatar
Norman Ziegner committed
    - python -m saqc --config sphinxdoc/resources/data/config.csv --data sphinxdoc/resources/data/data.csv --outfile /tmp/test.csv
Bert Palm's avatar
Bert Palm committed
# test saqc with python 3.8
python38:
  stage: test
David Schäfer's avatar
David Schäfer committed
  script:
    - pytest tests/core tests/funcs tests/integration dios/test -Werror
Norman Ziegner's avatar
Norman Ziegner committed
    - python -m saqc --config sphinxdoc/resources/data/config.csv --data sphinxdoc/resources/data/data.csv --outfile /tmp/test.csv
Bert Palm's avatar
Bert Palm committed

David Schäfer's avatar
David Schäfer committed

# test saqc with python 3.9
python39:
  stage: test
  image: python:3.9
  script:
    - pytest tests/core tests/funcs tests/integration dios/test -Werror
Norman Ziegner's avatar
Norman Ziegner committed
    - python -m saqc --config sphinxdoc/resources/data/config.csv --data sphinxdoc/resources/data/data.csv --outfile /tmp/test.csv
# check if everthing is properly formatted
black:
  stage: test
  script:
Bert Palm's avatar
Bert Palm committed

David Schäfer's avatar
David Schäfer committed

Bert Palm's avatar
Bert Palm committed
# make (visual) coverage in gitlab merge request diff's
coverage:
  stage: test
Bert Palm's avatar
Bert Palm committed
  script:
    - pip install pytest-cov coverage
    - pytest --cov=saqc tests/core tests/funcs -Werror
Bert Palm's avatar
Bert Palm committed
  after_script:
    - coverage xml

  # regex to find the coverage percentage in the job output
  coverage: '/^TOTAL.+?(\d+\%)$/'

  artifacts:
    when: always
    reports:
      cobertura: coverage.xml

# Check compliance with the REUSE specification
reuse_compliance:
  stage: test
  image:
    name: fsfe/reuse:latest
    entrypoint: [""]
  before_script:
    - echo "Override default 'before_script'..."
  script:
    - reuse lint
Bert Palm's avatar
Bert Palm committed

# make html docu with sphinx
Bert Palm's avatar
Bert Palm committed
pages:
  stage: deploy
Bert Palm's avatar
Bert Palm committed
  script:
    - pip install -r requirements_sphinx.txt
    - make doc
Bert Palm's avatar
Bert Palm committed
    - cp -r _build/html ../public
  artifacts:
    paths:
      - public


# ===========================================================
# scheduled jobs
# ===========================================================

# fuzzy testing saqc
fuzzy:
  stage: test
Bert Palm's avatar
Bert Palm committed
  only:
    - pytest tests/fuzzy -Werror


# test lib saqc
testLib:
  stage: test
  only:
    - schedules
  script:
    - pytest tests/lib -Werror