From c2a54cbd8482fc845387baca5cf6ec4484fb43d1 Mon Sep 17 00:00:00 2001 From: Mohit Garg Date: Fri, 24 Apr 2026 16:17:01 +0530 Subject: [PATCH] ci: add wheel+verify job, extras resolution matrix, py3.10, pip cache Closes four real gaps in the CI pipeline that let packaging and dependency regressions slip through to users: - verify job: builds the wheel, installs from the built artifact (not `-e .`), asserts `_verify_data/` is present in site-packages, and runs `gdb verify` end-to-end. Catches the "works editable, broken in wheel" class of bugs around package-data globs. - extras job: matrix over openai, anthropic, gemini, hub, metrics, all-providers. Surfaces broken version pins in optional deps at CI time instead of on a user's machine. Heavy ML extras (svg-/lottie-/layout-metrics, vllm*) are intentionally excluded. - test matrix: add Python 3.10 (requires-python is >=3.9, and 3.10 is the default on Ubuntu 22.04 / many corporate envs). - pip cache via setup-python's built-in cache: 'pip' (shaves ~10s per job). - concurrency cancel for PR runs (keeps main history intact). Verified locally: wheel build + install-from-wheel + `gdb verify` produces metrics for all 5 v0-smoke benchmarks and exits 0. Made-with: Cursor --- .github/workflows/ci.yml | 64 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa4b432..f99bfe7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,11 @@ on: permissions: contents: read +# Cancel superseded PR runs; keep main runs so we get a green history. +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + jobs: lint: runs-on: ubuntu-latest @@ -17,19 +22,22 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.12" + cache: 'pip' - run: pip install ruff - run: ruff check src/ scripts/ tests/ test: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - python-version: ["3.9", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - run: pip install -e ".[dev]" - name: Registry sanity run: | @@ -44,3 +52,57 @@ jobs: run: pytest tests/ -v - name: Legacy shim smoke run: python scripts/run_benchmarks.py --list + + # Build the wheel, install it from the built artifact (not editable), and run + # the bundled smoke test. Catches the "works in -e ., broken in wheel" class + # of bugs — specifically package-data globs for _verify_data/. + verify: + name: verify (wheel + bundled fixture) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: 'pip' + - name: Build wheel + run: | + pip install build + rm -rf dist/ + python -m build --wheel + - name: Install from wheel + run: pip install dist/lica_gdb-*.whl + - name: Assert bundled fixture ships in wheel + run: | + python -c " + from pathlib import Path + import gdb + root = Path(gdb.__file__).parent / '_verify_data' + assert root.is_dir(), f'{root} missing from installed wheel' + assert (root / 'benchmarks').is_dir(), 'bundled benchmarks/ missing' + print(f'bundled fixture OK: {root}') + " + - name: gdb verify (zero-config smoke test) + run: gdb verify + + # Resolve each optional extra independently so a broken version pin in one + # provider or metrics bundle fails loudly here, not on a user's machine. + # Heavy ML extras (svg-metrics / lottie-metrics / layout-metrics / vllm*) + # pull in torch/transformers/GPU deps and are intentionally excluded. + extras: + name: extras (${{ matrix.extra }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + extra: [openai, anthropic, gemini, hub, metrics, all-providers] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: 'pip' + - name: Install extra + run: pip install -e ".[${{ matrix.extra }}]" + - name: Smoke import gdb + run: python -c "import gdb; print(gdb.__version__)"