-
Frederik Arnold authoredFrederik Arnold authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
.gitlab-ci.yml 1.48 KiB
# This file is a template, and might need editing before it works on your project.
# Official language image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/python/tags/
image: python:latest
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
paths:
- .cache/pip
- venv/
stages:
- test
- badge
- upload
- release
test:
stage: test
before_script:
- python -V
- pip install virtualenv
- virtualenv venv
- source venv/bin/activate
- pip install -r requirements.txt
- pip install coverage
script:
- coverage run --source=lotte,match,key_passager,visualization -m unittest discover -p 'Test*.py'
- coverage report -m
badge:
stage: badge
before_script:
- pip install anybadge
script:
- mkdir ./version
- echo $CI_COMMIT_TAG
- anybadge --label=Version --file=version/version.svg --color=teal --value=$CI_COMMIT_TAG
artifacts:
paths:
- ./version/
only:
- tags
upload:
stage: upload
script:
- pip install twine
- cat $PYPIRC > /tmp/.pypirc
- python -m pip install --upgrade build
- python -m build
- python -m twine upload --repository pypi dist/* --config-file /tmp/.pypirc
only:
- tags
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo $CI_COMMIT_TAG
release:
tag_name: $CI_COMMIT_TAG
name: 'Lotte $CI_COMMIT_TAG'
description: 'Release $CI_COMMIT_TAG'
only:
- tags