84 lines
2.0 KiB
YAML
84 lines
2.0 KiB
YAML
when:
|
|
event: [push, pull_request]
|
|
branch: [dev, main, master]
|
|
|
|
steps:
|
|
- name: deps
|
|
image: python:3.13
|
|
volumes:
|
|
- /tmp/uv-cache:/root/.cache/uv
|
|
environment:
|
|
UV_CACHE_DIR: /root/.cache/uv
|
|
UV_LINK_MODE: copy
|
|
commands:
|
|
- pip install uv
|
|
- cd ..
|
|
- |
|
|
cat > pyproject.toml << 'EOF'
|
|
[project]
|
|
name = "pyaqa"
|
|
version = "0.1.0"
|
|
requires-python = ">=3.13"
|
|
dependencies = []
|
|
|
|
[tool.uv.workspace]
|
|
members = ["blog.pyaqa.ru", "pytfm"]
|
|
EOF
|
|
- git clone https://git.pyaqa.ru/pi3c/pytfm.git
|
|
- cd $CI_WORKSPACE
|
|
- rm -rf .venv
|
|
- uv sync --no-dev --group lints --group tests --group types --group dev
|
|
- uv run --no-sync playwright install chromium
|
|
|
|
- name: lint
|
|
image: python:3.13
|
|
volumes:
|
|
- /tmp/uv-cache:/root/.cache/uv
|
|
environment:
|
|
UV_CACHE_DIR: /root/.cache/uv
|
|
UV_LINK_MODE: copy
|
|
depends_on: [deps]
|
|
commands:
|
|
- pip install uv
|
|
- uv run --no-sync ruff check .
|
|
- uv run --no-sync ruff format --check .
|
|
- uv run --no-sync isort --check-only .
|
|
|
|
- name: type
|
|
image: python:3.13
|
|
volumes:
|
|
- /tmp/uv-cache:/root/.cache/uv
|
|
environment:
|
|
UV_CACHE_DIR: /root/.cache/uv
|
|
UV_LINK_MODE: copy
|
|
depends_on: [deps]
|
|
commands:
|
|
- pip install uv
|
|
- uv run --no-sync mypy .
|
|
|
|
- name: test-unit
|
|
image: python:3.13
|
|
volumes:
|
|
- /tmp/uv-cache:/root/.cache/uv
|
|
environment:
|
|
UV_CACHE_DIR: /root/.cache/uv
|
|
UV_LINK_MODE: copy
|
|
depends_on: [deps]
|
|
commands:
|
|
- pip install uv
|
|
- uv run --no-sync pytest tests/unit/
|
|
|
|
- name: test-e2e
|
|
image: python:3.13
|
|
volumes:
|
|
- /tmp/uv-cache:/root/.cache/uv
|
|
environment:
|
|
UV_CACHE_DIR: /root/.cache/uv
|
|
UV_LINK_MODE: copy
|
|
depends_on: [deps]
|
|
commands:
|
|
- pip install uv
|
|
- uv run --no-sync blog &
|
|
- sleep 5
|
|
- uv run --no-sync pytest tests/e2e/ -v --no-cov
|