Update .drone.yml
This commit is contained in:
76
.drone.yml
76
.drone.yml
@@ -1,48 +1,84 @@
|
|||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: python-ci
|
name: python-uv-ci
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event: [ pull_request ]
|
event: [ pull_request ]
|
||||||
|
|
||||||
|
# Cache to speed up uv between steps (optional but nice)
|
||||||
|
volumes:
|
||||||
|
- name: uv-cache
|
||||||
|
temp: {}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: setup+deps
|
- name: lint+typecheck
|
||||||
image: python:3.13-slim
|
image: python:3.13-slim
|
||||||
|
volumes:
|
||||||
|
- name: uv-cache
|
||||||
|
path: /root/.cache/uv
|
||||||
environment:
|
environment:
|
||||||
UV_NO_SYNC_PROGRESS: "1"
|
UV_NO_SYNC_PROGRESS: "1"
|
||||||
|
PYVER: "3.13"
|
||||||
commands:
|
commands:
|
||||||
- python -V
|
|
||||||
- apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
|
- apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||||
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
- export PATH="$HOME/.local/bin:$PATH"
|
- export PATH="$HOME/.local/bin:$PATH"
|
||||||
# pick python version (use .python-version if present, else 3.12)
|
- uv --version
|
||||||
- PYVER="$( [ -f .python-version ] && cat .python-version || echo 3.12 )"
|
|
||||||
- uv python install "$PYVER"
|
- uv python install "$PYVER"
|
||||||
- uv venv .venv
|
|
||||||
- . .venv/bin/activate
|
|
||||||
# install project + dev tools
|
|
||||||
- |
|
- |
|
||||||
if [ -f pyproject.toml ] && grep -q "\[tool\.uv\]" pyproject.toml; then
|
if [ -f pyproject.toml ] && grep -q "\[tool\.uv\]" pyproject.toml; then
|
||||||
uv sync --all-extras --dev
|
uv sync --all-extras --dev
|
||||||
else
|
else
|
||||||
uv pip install -e ".[dev]" || true
|
uv pip install -e ".[dev]" || true
|
||||||
if [ -f requirements.txt ]; then uv pip install -r requirements.txt; fi
|
[ -f requirements.txt ] && uv pip install -r requirements.txt || true
|
||||||
fi
|
fi
|
||||||
- uv pip install pytest pytest-cov mypy ruff
|
- uv pip install ruff mypy pytest pytest-cov
|
||||||
|
- uv run ruff check .
|
||||||
- name: lint-typecheck
|
- uv run mypy --ignore-missing-imports .
|
||||||
image: python:3.13-slim
|
|
||||||
commands:
|
|
||||||
- export PATH="$HOME/.local/bin:$PATH"
|
|
||||||
- . .venv/bin/activate
|
|
||||||
- ruff check .
|
|
||||||
- mypy --ignore-missing-imports .
|
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
image: python:3.13-slim
|
image: python:3.13-slim
|
||||||
|
volumes:
|
||||||
|
- name: uv-cache
|
||||||
|
path: /root/.cache/uv
|
||||||
|
environment:
|
||||||
|
UV_NO_SYNC_PROGRESS: "1"
|
||||||
|
PYVER: "3.13"
|
||||||
commands:
|
commands:
|
||||||
|
- apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||||
|
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
- export PATH="$HOME/.local/bin:$PATH"
|
- export PATH="$HOME/.local/bin:$PATH"
|
||||||
- . .venv/bin/activate
|
- uv python install "$PYVER"
|
||||||
- pytest -q --maxfail=1 --disable-warnings --cov --cov-report=term-missing
|
- |
|
||||||
|
if [ -f pyproject.toml ] && grep -q "\[tool\.uv\]" pyproject.toml; then
|
||||||
|
uv sync --all-extras --dev
|
||||||
|
else
|
||||||
|
uv pip install -e ".[dev]" || true
|
||||||
|
[ -f requirements.txt ] && uv pip install -r requirements.txt || true
|
||||||
|
fi
|
||||||
|
- uv pip install pytest pytest-cov
|
||||||
|
- uv run pytest -q --maxfail=1 --disable-warnings --cov --cov-report=term-missing
|
||||||
|
|
||||||
|
- name: build-wheel
|
||||||
|
image: python:3.13-slim
|
||||||
|
volumes:
|
||||||
|
- name: uv-cache
|
||||||
|
path: /root/.cache/uv
|
||||||
|
environment:
|
||||||
|
UV_NO_SYNC_PROGRESS: "1"
|
||||||
|
PYVER: "3.13"
|
||||||
|
commands:
|
||||||
|
- apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||||
|
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
||||||
|
- export PATH="$HOME/.local/bin:$PATH"
|
||||||
|
- uv python install "$PYVER"
|
||||||
|
- |
|
||||||
|
if [ -f pyproject.toml ] && grep -q "\[tool\.uv\]" pyproject.toml; then
|
||||||
|
uv sync --all-extras --dev
|
||||||
|
else
|
||||||
|
uv pip install -e ".[dev]" || true
|
||||||
|
[ -f requirements.txt ] && uv pip install -r requirements.txt || true
|
||||||
|
fi
|
||||||
|
- uv build
|
||||||
|
- ls -lh dist
|
||||||
|
|||||||
Reference in New Issue
Block a user