mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-14 21:52:56 +08:00
* ✨ 新增Pyright Lint工作流 * ✨ 新增Ruff Lint工作流 * 👷 添加pydanitc矩阵 * 👷 添加手动触发支持 --------- Co-authored-by: BalconyJH <balconyjh@gmail.com>
56 lines
1.3 KiB
YAML
56 lines
1.3 KiB
YAML
name: Pyright Lint
|
|
|
|
on:
|
|
workflow_call:
|
|
|
|
workflow_dispatch:
|
|
inputs:
|
|
python-version:
|
|
description: "Python version"
|
|
required: false
|
|
type: choice
|
|
options:
|
|
- "all"
|
|
- "3.10"
|
|
- "3.11"
|
|
- "3.12"
|
|
default: "all"
|
|
debug-mode:
|
|
description: "enable debug mode"
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
|
|
jobs:
|
|
pyright:
|
|
name: Pyright Lint
|
|
runs-on: ubuntu-latest
|
|
concurrency:
|
|
group: pyright-${{ github.ref }}-${{ matrix.env }}
|
|
cancel-in-progress: true
|
|
strategy:
|
|
matrix:
|
|
env: [pydantic-v1, pydantic-v2]
|
|
fail-fast: false
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Python environment
|
|
uses: ./.github/actions/setup-python
|
|
with:
|
|
env-dir: ./envs/${{ matrix.env }}
|
|
no-root: true
|
|
|
|
- run: |
|
|
(cd ./envs/${{ matrix.env }} && echo "$(poetry env info --path)/bin" >> $GITHUB_PATH)
|
|
if [ "${{ matrix.env }}" = "pydantic-v1" ]; then
|
|
sed -i 's/PYDANTIC_V2 = true/PYDANTIC_V2 = false/g' ./pyproject.toml
|
|
fi
|
|
shell: bash
|
|
|
|
- name: Run Pyright Check
|
|
uses: jakebailey/pyright-action@v2
|
|
with:
|
|
pylance-version: latest-release
|