.drone.yml
kind: pipeline
type: docker
name: test
steps:
- name: Test Python
image: python:3.12-slim
commands:
- apt-get update && apt-get install -y curl git
- curl -L "https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-$(dpkg --print-architecture)" > "${HOME}/bin/cc-test-reporter"
- chmod +x "${HOME}/bin/cc-test-reporter"
- pip install -e .[test]
- ruff check .
- mypy . --strict --exclude build
- cc-test-reporter before-build
- coverage run -m unittest
- exitcode="$?"
- coverage report -m
- coverage xml
- cc-test-reporter after-build --exit-code "$exitcode"
environment:
CC_TEST_REPORTER_ID: bd2c514a321b9b6f54c6e4820c9d907820b953b3ef394ab47c53b85eb924a8d0
- name: Test Python Packaging
image: python:3.12-slim
commands:
- pip install build twine
- python -m build
- twine check --strict dist/*
- name: Upload Python
depends_on:
- Test Python
- Test Python Packaging
environment:
TWINE_USERNAME:
from_secret: twine_username
TWINE_PASSWORD:
from_secret: twine_password
image: python:3.12-slim
commands:
- pip install build twine
- python -m build
- twine upload dist/*
when:
event:
- tag