feat: 第三优先级完善 — CI/CD、PyPI、pre-commit、CHANGELOG、贡献指南、基准测试、ADR
CI / Test (Python 3.13) (push) Has been cancelled

This commit is contained in:
2026-07-11 20:13:36 +08:00
parent 7e0b9553c8
commit 2ddb6de92f
13 changed files with 483 additions and 12 deletions
+48
View File
@@ -0,0 +1,48 @@
# CI
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.13"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: uv sync --extra dev --extra all
- name: Run lint (ruff)
run: uv run ruff check src/ tests/
- name: Run type check (mypy)
run: uv run mypy src/ --ignore-missing-imports
- name: Run tests with coverage
run: |
uv run pytest tests/ \
--cov=src \
--cov-report=term-missing \
--cov-report=xml \
-v
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: ./coverage.xml
fail_ci_if_error: false
+28
View File
@@ -0,0 +1,28 @@
# Publish to PyPI
name: Publish to PyPI
on:
push:
tags:
- "v*"
jobs:
publish:
name: Build and publish
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Build package
run: uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/