mr-test.yml•1.95 kB
name: MR Checks
on: [ pull_request ]
jobs:
python-check:
strategy:
max-parallel: 3
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: '**/pyproject.toml'
# 缓存 Poetry 依赖
- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-${{ matrix.python-version }}-
# 缓存 nox 环境
- name: Cache nox environments
uses: actions/cache@v4
with:
path: .nox
key: ${{ runner.os }}-nox-${{ matrix.python-version }}-${{ hashFiles('**/noxfile.py') }}
restore-keys: |
${{ runner.os }}-nox-${{ matrix.python-version }}-
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install uv
uv --version
- name: Install dependencies
run: |
uvx poetry install
# Test that package can be imported after installation
- name: Test package import
run: |
uvx poetry run python -c "import wecom_bot_mcp_server; from wecom_bot_mcp_server import mcp, send_message, send_wecom_file, send_wecom_image; print('All imports successful')"
- name: Lint
run: |
uvx nox -s lint
- name: Test
run: |
uvx nox -s pytest