Skip to content

Update version.py to v1.0.7 #856

Update version.py to v1.0.7

Update version.py to v1.0.7 #856

Workflow file for this run

name: Python tests
on:
push:
branches: [ "main" ]
paths:
- "**/*.py"
- "requirements*.txt"
- ".github/workflows/*.yml"
pull_request:
branches: [ "main" ]
paths:
- "**/*.py"
- "requirements*.txt"
- ".github/workflows/*.yml"
jobs:
test:
name: Run tests on ${{ matrix.os }} with Python ${{ matrix.python }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python: ["3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
# 仅 Linux:释放 GitHub runner 的大块预装组件,立刻回收十几 GB
- name: Free up disk space on Linux
if: runner.os == 'Linux'
run: |
df -h
sudo rm -rf /usr/local/lib/android || true
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /opt/ghc || true
sudo rm -rf /opt/hostedtoolcache/CodeQL || true
docker system prune -af || true
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/*
df -h
# 安装 uv(正确的官方 action)
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true # 远端缓存 uv 自身(对磁盘占用很小)
# 用系统 Python 安装依赖,禁用缓存,避免写入大体积 wheel 缓存
- name: Install dependencies
env:
UV_SYSTEM_PYTHON: "1"
run: |
uv pip install --no-cache -r requirements.txt
uv pip install -e .
- name: Run tests on Windows
if: startsWith(matrix.os, 'windows')
env:
PYTHONDONTWRITEBYTECODE: 1
run: |
pytest -m cpu test
- name: Run tests on Linux / macOS
if: ${{ !startsWith(matrix.os, 'windows') }}
env:
PYTHONDONTWRITEBYTECODE: 1
run: |
pytest -m cpu test