-
-
Notifications
You must be signed in to change notification settings - Fork 1
139 lines (116 loc) · 4.29 KB
/
Copy pathschema-compat.yml
File metadata and controls
139 lines (116 loc) · 4.29 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
# workflows/schema-compat.yml
#
# Schema Compatibility Check
# Validates that the sqlalchemy-paradedb API wrapper stays in sync with the
# ParadeDB SQL schema and that integration tests pass against the new version.
# Triggered automatically on each paradedb release (via repository_dispatch)
# or manually via workflow_dispatch.
name: Schema Compatibility Check
on:
repository_dispatch:
types: [paradedb-release]
workflow_dispatch:
inputs:
version:
description: "ParadeDB version to check against"
required: true
concurrency:
group: schema-compat-${{ github.head_ref || github.ref }}
cancel-in-progress: true
env:
PARADEDB_VERSION: ${{ inputs.version || github.event.client_payload.version }}
jobs:
schema-compat:
name: Check Schema Compatibility
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Download pg_search.schema.sql
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release download "v${{ env.PARADEDB_VERSION }}" \
--repo paradedb/paradedb \
--pattern pg_search.schema.sql
- name: Run Schema Compatibility Check
run: python scripts/check_schema_compat.py pg_search.schema.sql api.json
integration-tests:
name: Integration Tests
runs-on: ubuntu-latest
services:
paradedb:
image: paradedb/paradedb:${{ inputs.version || github.event.client_payload.version }}-pg18
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d postgres"
--health-interval 10s
--health-timeout 5s
--health-retries 12
env:
PARADEDB_TEST_DSN: postgresql+psycopg://postgres:postgres@localhost:5432/postgres
DATABASE_URL: postgresql+psycopg://postgres:postgres@localhost:5432/postgres
PGPASSWORD: postgres
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install dependencies
run: |
uv venv --python "3.13"
uv sync --extra test
- name: Install pg client
run: sudo apt-get update && sudo apt-get install -y postgresql-client
- name: Wait for ParadeDB
run: |
for i in {1..30}; do
pg_isready -h localhost -p 5432 -U postgres -d postgres && exit 0
sleep 2
done
echo "ParadeDB did not become ready" >&2
exit 1
- name: Run unit tests
run: uv run --no-sync pytest tests/unit
- name: Run integration tests
run: uv run --no-sync pytest -m integration
notify:
name: Notify on Failure
runs-on: ubuntu-latest
needs: [schema-compat, integration-tests]
if: failure()
steps:
- name: Create GitHub Issue
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh issue create \
--repo ${{ github.repository }} \
--title "Schema compat failure for ParadeDB v${{ env.PARADEDB_VERSION }}" \
--body "$(cat <<EOF
The schema compatibility check or integration tests failed against ParadeDB **v${{ env.PARADEDB_VERSION }}**.
**Workflow run:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
Please investigate and update sqlalchemy-paradedb as needed.
EOF
)" \
--label bug
- name: Notify Slack on Failure
run: |
GITHUB_RUN_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
MESSAGE="<!here> \`schema-compat\` workflow failed for ParadeDB v${{ env.PARADEDB_VERSION }} in \`${{ github.repository }}\` -- investigate immediately! GitHub Action Logs: ${GITHUB_RUN_URL}"
curl -X POST -H 'Content-type: application/json' -d "{\"text\": \"${MESSAGE}\"}" ${{ secrets.SLACK_GITHUB_CHANNEL_WEBHOOK_URL }}