-
Notifications
You must be signed in to change notification settings - Fork 20
85 lines (71 loc) · 2.06 KB
/
integration-postgres-ci.yml
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
name: Postgres Integration CI
on:
pull_request:
paths:
- "grai-integrations/source-postgres/**"
- "grai-client/**"
- "grai-server/**"
- ".github/workflows/integration-postgres-ci.yml"
concurrency:
group: ${{ github.ref }}-postgres-ci
cancel-in-progress: true
env:
project_dir: "grai-integrations/source-postgres"
py_ver: "${{ vars.PY_VER }}"
poetry_ver: "${{ vars.POETRY_VER }}"
jobs:
lint-integration-postgres:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.project_dir }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "${{ env.py_ver }}"
- run: pip install black isort
- run: |
black . --check
isort . --profile black --check
tests-integration-postgres:
needs: lint-integration-postgres
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.project_dir }}
services:
postgres:
image: ankane/pgvector:latest
env:
POSTGRES_USER: grai
POSTGRES_PASSWORD: grai
POSTGRES_DB: grai
ports:
- 5433:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 15
steps:
- uses: actions/checkout@v4
- name: Set up Postgres db
working-directory: ${{ env.project_dir }}/dev-database
env:
POSTGRES_USER: grai
POSTGRES_PASSWORD: grai
POSTGRES_DB: grai
PORT: 5433
HOST: postgres
run: |
bash init-db.sh
- uses: actions/setup-python@v5
with:
python-version: "${{ env.py_ver }}"
- uses: abatilo/actions-poetry@v2
with:
poetry-version: "${{ env.poetry_ver }}"
- run: poetry install
- name: Run Postgres Tests
run: poetry run pytest