Files
qqbotsdk/.github/workflows/ci.yml
T

65 lines
1.4 KiB
YAML

name: 代码检测
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: ruff + pyright + pytest
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12", "3.13"]
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: 安装 uv 与 Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: 同步依赖(含 dev 组)
run: uv sync
- name: ruff 静态检查
run: uv run ruff check src tests examples
- name: ruff 格式检查
run: uv run ruff format --check src tests examples
- name: pyright 类型检查
run: uv run pyright
- name: pytest 单元测试
run: uv run pytest
build:
name: 构建发行包
runs-on: ubuntu-latest
steps:
- name: 检出代码
uses: actions/checkout@v4
- name: 安装 uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
- name: 构建 sdist 与 wheel
run: uv build
- name: 上传构建产物
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/