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__)"