-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (118 loc) · 4.53 KB
/
Copy pathci.yml
File metadata and controls
141 lines (118 loc) · 4.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: CI
on:
push:
branches: [main]
paths-ignore: ['README.md']
pull_request:
branches: [main]
paths-ignore: ['README.md']
workflow_dispatch:
permissions:
contents: read
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
- 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_vision/ vision_worker.py
- name: Docstring lint (pydoclint)
run: uvx pydoclint --config pyproject.toml vgi_vision/ vision_worker.py
# 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:
# subprocess : `uv run vision_worker.py` (stdio; extension spawns it)
# http : `http://127.0.0.1:<port>` (worker booted with --http)
# unix : `unix:///tmp/vision.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. WORKER_CMD
# is used directly as the stdio LOCATION for subprocess, and as the
# process the harness boots for --http / --unix; the new
# run-integration.sh derives VGI_VISION_WORKER itself per $TRANSPORT.
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/vision_worker.py" >> "$GITHUB_ENV"
- name: Run extension integration suite (${{ matrix.transport }})
run: ci/run-integration.sh
env:
TRANSPORT: ${{ matrix.transport }}