chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:34:57 +08:00
commit 1ccb4e58d2
80 changed files with 21133 additions and 0 deletions
+44
View File
@@ -0,0 +1,44 @@
name: CI
on:
push:
branches: [main, "optimize/**"]
pull_request:
branches: [main]
jobs:
test:
name: pytest (py${{ matrix.python-version }} / ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "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 test
- name: Run unit tests
run: uv run pytest tests/unit -q --cov=myboot --cov-report=term-missing
- name: Run integration tests
shell: bash
# 退出码 5 = 未收集到用例(集成测试目录暂为空时不视为失败)
run: uv run pytest tests/integration -q -m integration || [ $? -eq 5 ]
- name: Upload coverage report
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: .coverage
include-hidden-files: true
+40
View File
@@ -0,0 +1,40 @@
name: Publish to PyPI
on:
push:
tags:
- "v*" # 匹配所有以 v 开头的 tag,如 v1.0.0, v0.1.0
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # 用于 trusted publishing (OIDC)
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build hatchling
- name: Build distribution packages
run: |
python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
# 使用 trusted publishing (推荐方式,无需 token)
# 需要在 PyPI 上配置 trusted publishing
# 参考: https://docs.pypi.org/trusted-publishers/
print-hash: true # 显示上传文件的哈希值,便于验证