Skip to content

Reach vgi-lint 100/100; add languages reference view; upgrade SDK #16

Reach vgi-lint 100/100; add languages reference view; upgrade SDK

Reach vgi-lint 100/100; add languages reference view; upgrade SDK #16

Workflow file for this run

# Copyright 2026 Query Farm LLC - https://query.farm
#
# Unit tests (pytest), lint, and the sqllogictest extension suite
# (test/sql/*.test) run against the vgi-translate worker through the real signed
# `vgi` DuckDB community extension via a prebuilt standalone `haybarn-unittest`.
# 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 --all-extras
# Runs the full suite. The single real en->es translation test
# (tests/test_translate.py) downloads an Argos package; it self-skips if
# the download is unavailable, so CI stays green offline.
- name: Run tests
run: uv run pytest -q
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 --all-extras
- name: Check formatting
run: uv run ruff format --check .
- name: Check linting
run: uv run ruff check .
- name: Type check (mypy)
run: uv run mypy vgi_translate translate_worker.py
# Run pydoclint in an isolated env (uvx): the dev venv also contains
# vgi-rpc's `docstring-parser`, which collides with pydoclint's required
# `docstring-parser-fork` in the shared `docstring_parser` import namespace.
- name: Docstring lint (pydoclint)
run: uvx pydoclint --config pyproject.toml vgi_translate translate_worker.py
# Metadata-quality gate: build the worker, then run the vgi-lint metadata
# linter (catalog/schema/function descriptions, examples, support tags, …).
# Kept as a separate job so its result is visible at a glance.
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
run: uv sync --all-extras --python 3.13
- name: vgi-lint
uses: Query-farm/vgi-lint-check@v1
with:
version: "0.73.0"
# Lint the worker via the project venv's Python, NOT `uv run
# translate_worker.py`: the PEP 723 script env `uv run` builds caches an
# SDK independently of the synced venv and can emit the pre-0.16 catalog
# schema, producing a false ATTACH/schema mismatch. `uv sync --all-extras`
# (above) puts the current SDK in `.venv`.
location: ".venv/bin/python translate_worker.py"
fail-on: info
# 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:
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)
run: uv sync --frozen --python 3.13 --extra http
# The real-translation E2E cases need the Argos en->es package in the user
# data home. detect_lang E2E is offline and always runs.
- name: Pre-install Argos en->es package
run: uv run --python 3.13 python scripts/ensure_argos_pair.py en es
- 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
# is a repo-root PEP 723 script (no console-script); `uv run` reads its
# inline deps and resolves them from PyPI, so an absolute script path
# spawns correctly regardless of cwd.
UNITTEST="$PWD/$(find hb -name 'haybarn-unittest' -type f | head -1)"
chmod +x "$UNITTEST"
echo "HAYBARN_UNITTEST=$UNITTEST" >> "$GITHUB_ENV"
echo "WORKER_CMD=uv run --python 3.13 $PWD/translate_worker.py" >> "$GITHUB_ENV"
- name: Run extension integration suite (${{ matrix.transport }})
run: ci/run-integration.sh
env:
TRANSPORT: ${{ matrix.transport }}