66 lines
1.3 KiB
YAML
66 lines
1.3 KiB
YAML
---
|
|
################
|
|
# Test #
|
|
################
|
|
|
|
kind: pipeline
|
|
name: default
|
|
type: docker
|
|
|
|
steps:
|
|
# Run tests against Python with pytest
|
|
- name: test
|
|
image: python:3.8
|
|
commands:
|
|
# Install dependencies
|
|
- pip install poetry
|
|
- poetry install -E eth
|
|
- poetry run pylint cic --fail-under=8.00
|
|
- poetry run pytest
|
|
environment:
|
|
LOGLEVEL: info
|
|
|
|
volumes:
|
|
- name: poetry_cache
|
|
path: /root/.cache/pypoetry
|
|
- name: pip_cache
|
|
path: /root/.cache/pip
|
|
when:
|
|
event:
|
|
- push
|
|
- name: publish
|
|
image: python:3.8
|
|
commands:
|
|
# Install dependencies
|
|
- pip install poetry
|
|
- poetry install
|
|
- poetry run semantic-release publish
|
|
depends_on:
|
|
- test
|
|
when:
|
|
branch:
|
|
- master
|
|
event:
|
|
- push
|
|
environment:
|
|
LOGLEVEL: info
|
|
GIT_SSL_NO_VERIFY: 1
|
|
REPOSITORY_USERNAME: __token__
|
|
REPOSITORY_PASSWORD:
|
|
from_secret: pypi_token
|
|
GITEA_TOKEN:
|
|
from_secret: gitea_token
|
|
|
|
volumes:
|
|
- name: poetry_cache
|
|
path: /root/.cache/pypoetry
|
|
- name: pip_cache
|
|
path: /root/.cache/pip
|
|
volumes:
|
|
- name: poetry_cache
|
|
host:
|
|
path: /tmp/cache/drone/pypoetry
|
|
- name: pip_cache
|
|
host:
|
|
path: /tmp/cache/drone/pip
|