name: CI # 每次 push / PR 都跑,用于在打发布标签之前提前暴露问题 # (本机 Windows 上无法创建 asyncio 事件循环,所以 Linux 侧的首轮验证只能靠这里) on: push: branches: - main - develop pull_request: workflow_dispatch: permissions: contents: read concurrency: group: ci-${{ github.ref }} cancel-in-progress: true jobs: test: name: Test (Python ${{ matrix.python-version }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: python-version: ["3.11", "3.13"] steps: - name: Checkout uses: actions/checkout@v7 - name: Install uv uses: astral-sh/setup-uv@v10.1.0 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: uv sync --locked - name: Run tests run: uv run pytest -q build: name: Build check runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v7 - name: Install uv uses: astral-sh/setup-uv@v10.1.0 with: python-version: "3.13" - name: Build sdist and wheel run: uv build - name: Check distribution metadata run: uvx twine check dist/*