Enrich catalog doc_md for SEO; bump VGI SDK to latest release #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright 2026 Query Farm LLC - https://query.farm | |
| # | |
| # Unit tests (pytest), lint, and the sqllogictest extension suite | |
| # (test/sql/*.test) run against the vgi-wikipedia worker through the real signed | |
| # `vgi` DuckDB community extension via a prebuilt standalone `haybarn-unittest`. | |
| # The SQL E2E points the worker at a local mock MediaWiki server — no keys, no | |
| # cost, no live egress. See ci/README.md for the design. | |
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: ['README.md'] | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: ['README.md'] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Python ${{ matrix.python-version }} on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| python-version: ["3.13"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.2.0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: uv sync --frozen --all-extras | |
| # The `live` marker (real Wikipedia over the network) is excluded. | |
| - name: Run tests | |
| run: uv run --no-sync pytest -q -m "not live" | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.2.0 | |
| - name: Install dependencies | |
| run: uv sync --frozen --all-extras | |
| - name: Check formatting | |
| run: uv run --no-sync ruff format --check . | |
| - name: Check linting | |
| run: uv run --no-sync ruff check . | |
| - name: Type check (mypy) | |
| run: uv run --no-sync mypy vgi_wikipedia/ wikipedia_worker.py serve.py | |
| - name: Docstring lint (pydoclint) | |
| run: uvx pydoclint --config pyproject.toml vgi_wikipedia/ wikipedia_worker.py serve.py | |
| # Catalog/metadata quality gate: build the worker, then run vgi-lint against it | |
| # (the action force-installs the signed vgi community extension itself). Fails | |
| # the build on any finding at info or above. Kept a separate job for visibility. | |
| metadata-quality: | |
| name: Metadata quality (vgi-lint) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.2.0 | |
| - name: Set up Python 3.13 | |
| run: uv python install 3.13 | |
| - name: Install the worker (from the lockfile, with the http extra) | |
| run: uv sync --frozen --python 3.13 --extra http | |
| - name: vgi-lint | |
| uses: Query-farm/vgi-lint-check@v1 | |
| with: | |
| location: "uv run wikipedia_worker.py" | |
| fail-on: info | |
| version: "0.37.0" | |
| # Resolve the latest published haybarn release once, so the whole matrix tests | |
| # the same version (and we never hardcode/pin it). | |
| resolve-haybarn: | |
| name: Resolve haybarn release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| release: ${{ steps.r.outputs.release }} | |
| steps: | |
| - id: r | |
| run: | | |
| REL=$(gh release view --repo Query-farm-haybarn/haybarn --json tagName --jq .tagName) | |
| echo "release=$REL" >> "$GITHUB_OUTPUT" | |
| echo "Latest haybarn release: $REL" | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| integration: | |
| name: SQL E2E (${{ matrix.transport }}) on ${{ matrix.os }} | |
| needs: resolve-haybarn | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Run the SAME sqllogictest suite over every VGI transport. The vgi | |
| # extension picks the transport from the ATTACH LOCATION string that | |
| # run-integration.sh builds per $TRANSPORT. The mock MediaWiki server | |
| # stays up for ALL THREE transports; VGI_WIKIPEDIA_API_URL is EXPORTED | |
| # so both the DuckDB-spawned subprocess worker and the out-of-band | |
| # http/unix worker inherit it: | |
| # subprocess : `.venv/bin/python wikipedia_worker.py` (stdio) | |
| # http : `http://127.0.0.1:<port>` (worker booted with --http) | |
| # unix : `unix:///tmp/wiki-<pid>.sock` (worker booted with --unix) | |
| os: [ubuntu-latest, macos-latest] | |
| transport: [subprocess, http, unix] | |
| include: | |
| - { os: ubuntu-latest, asset: haybarn_unittest-linux-amd64.zip } | |
| - { os: macos-latest, asset: haybarn_unittest-osx-arm64.zip } | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v8.2.0 | |
| - name: Set up Python 3.13 | |
| run: uv python install 3.13 | |
| - name: Install the worker (from the lockfile, with the http extra) | |
| # The `http` extra pulls in waitress so the worker can serve `--http`. | |
| # Harmless for the subprocess/unix legs; required for the http leg. | |
| run: uv sync --frozen --python 3.13 --extra http | |
| - name: Download haybarn-unittest | |
| run: | | |
| gh release download "$HAYBARN_RELEASE" \ | |
| --repo Query-farm-haybarn/haybarn \ | |
| --pattern '${{ matrix.asset }}' \ | |
| --output haybarn-unittest.zip --clobber | |
| mkdir -p hb && unzip -o -q haybarn-unittest.zip -d hb | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| HAYBARN_RELEASE: ${{ needs.resolve-haybarn.outputs.release }} | |
| - name: Resolve runner + worker paths | |
| run: | | |
| # Absolute paths: run-integration.sh cd's into a staging dir before | |
| # invoking the runner, so relative paths would not resolve. The worker | |
| # runs from the synced .venv (deps resolved from PyPI via the lockfile); | |
| # plain `.venv/bin/python` ignores the PEP 723 header. run-integration.sh | |
| # starts the mock MediaWiki server and EXPORTS VGI_WIKIPEDIA_API_URL so | |
| # every transport's worker inherits it. WORKER_CMD is the stdio command | |
| # used directly for subprocess and booted with --http / --unix otherwise. | |
| UNITTEST="$PWD/$(find hb -name 'haybarn-unittest' -type f | head -1)" | |
| chmod +x "$UNITTEST" | |
| echo "HAYBARN_UNITTEST=$UNITTEST" >> "$GITHUB_ENV" | |
| echo "WORKER_CMD=$PWD/.venv/bin/python $PWD/wikipedia_worker.py" >> "$GITHUB_ENV" | |
| - name: Run extension integration suite (${{ matrix.transport }}) | |
| run: ci/run-integration.sh | |
| env: | |
| TRANSPORT: ${{ matrix.transport }} |