From 3a6c66a16f9c529bac3210eb15a95ad2fe526b2f Mon Sep 17 00:00:00 2001 From: pkuwkl Date: Thu, 23 Jul 2026 17:49:13 +0800 Subject: [PATCH] fix(ci): install from uv.lock via uv sync to stop cold-cache e2e timeouts The install step used `uv pip install -e .`, which ignores the tracked `uv.lock` and re-resolves the full dependency graph on every run. On the warm CI cache this is fast (~80s), but the path-filtered/scheduled e2e jobs run rarely, so their uv cache is usually evicted (GitHub drops caches after 7 days). On that cold cache, resolution alone took ~6m (probing sdist metadata and backtracking), and the `news` job's 10-minute timeout cancelled the install before it finished. Switch every job to `uv sync --frozen` (CI adds `--extra dev`), which reads the exact pins from `uv.lock` and skips resolution entirely, and key the setup-uv cache on `uv.lock` instead of `pyproject.toml`. Cold-cache installs now only download the locked wheels, landing well under the job timeouts. Verification: `bash scripts/verify.sh` (405 passed, 85.66% coverage); `uv sync --dry-run` and `uv sync --dry-run --extra dev` both resolve against the lockfile locally. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 4 ++-- .github/workflows/e2e.yml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58766e6..2e1816b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,13 +32,13 @@ jobs: uses: astral-sh/setup-uv@v3 with: enable-cache: true - cache-dependency-glob: pyproject.toml + cache-dependency-glob: uv.lock - name: Create virtual environment run: uv venv - name: Install project and development dependencies - run: uv pip install --python .venv/bin/python -e ".[dev]" + run: uv sync --frozen --extra dev - name: Run file-hygiene hooks run: | diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 3d3b158..e7a98a3 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -119,13 +119,13 @@ jobs: uses: astral-sh/setup-uv@v3 with: enable-cache: true - cache-dependency-glob: pyproject.toml + cache-dependency-glob: uv.lock - name: Create virtual environment run: uv venv - name: Install project runtime dependencies - run: uv pip install --python .venv/bin/python -e . + run: uv sync --frozen - name: Run live news E2E run: .venv/bin/python scripts/verify_news_e2e.py @@ -151,13 +151,13 @@ jobs: uses: astral-sh/setup-uv@v3 with: enable-cache: true - cache-dependency-glob: pyproject.toml + cache-dependency-glob: uv.lock - name: Create virtual environment run: uv venv - name: Install project runtime dependencies - run: uv pip install --python .venv/bin/python -e . + run: uv sync --frozen - name: Check OpenAI credential id: openai @@ -195,13 +195,13 @@ jobs: uses: astral-sh/setup-uv@v3 with: enable-cache: true - cache-dependency-glob: pyproject.toml + cache-dependency-glob: uv.lock - name: Create virtual environment run: uv venv - name: Install project runtime dependencies - run: uv pip install --python .venv/bin/python -e . + run: uv sync --frozen - name: Check OpenRouter credential id: openrouter