38 lines
1.3 KiB
YAML
38 lines
1.3 KiB
YAML
# Woodpecker CI - Test Pipeline (runs on PRs and pushes)
|
|
|
|
steps:
|
|
- name: lint
|
|
image: python:3.11-slim
|
|
commands:
|
|
- pip install --quiet ruff mypy
|
|
- echo "=== Linting with ruff ==="
|
|
- ruff check services/ shared/ --output-format=github
|
|
- echo "=== Checking formatting ==="
|
|
- ruff format --check services/ shared/
|
|
|
|
- name: typecheck
|
|
image: python:3.11-slim
|
|
commands:
|
|
- pip install --quiet mypy types-redis
|
|
- echo "=== Type checking shared/ ==="
|
|
- mypy shared/ --ignore-missing-imports || true
|
|
|
|
- name: unit-tests
|
|
image: python:3.11-slim
|
|
commands:
|
|
- pip install --quiet pytest pytest-asyncio pytest-cov
|
|
- pip install --quiet redis asyncpg grpcio grpcio-tools psutil pydantic pydantic-settings structlog
|
|
- echo "=== Running unit tests ==="
|
|
- pytest shared/ services/ -v --tb=short --cov=shared --cov=services --cov-report=term-missing || true
|
|
|
|
- name: proto-check
|
|
image: python:3.11-slim
|
|
commands:
|
|
- pip install --quiet grpcio-tools
|
|
- echo "=== Validating proto definitions ==="
|
|
- python -m grpc_tools.protoc -I./proto --python_out=/tmp --grpc_python_out=/tmp ./proto/metrics.proto
|
|
- echo "Proto compilation successful"
|
|
|
|
when:
|
|
- event: [push, pull_request]
|