Skip to content

Commit ca1f80a

Browse files
committed
Add pgvector to ci
1 parent 95fcfb0 commit ca1f80a

File tree

1 file changed

+31
-3
lines changed

1 file changed

+31
-3
lines changed

.github/workflows/workflow.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
11
name: CI
22

3-
'on':
4-
- push
3+
on:
4+
push:
5+
pull_request:
56

67
jobs:
78
build:
89
runs-on: ubuntu-latest
910

11+
services:
12+
postgres:
13+
image: ankane/pgvector
14+
ports:
15+
- 5445:5432
16+
env:
17+
POSTGRES_USER: myuser
18+
POSTGRES_PASSWORD: mypassword
19+
POSTGRES_DB: mydatabase
20+
options: >-
21+
--health-cmd pg_isready
22+
--health-interval 10s
23+
--health-timeout 5s
24+
--health-retries 5
25+
26+
redis:
27+
image: redis:7
28+
ports:
29+
- 6370:6379
30+
1031
steps:
1132
- name: Checkout code
1233
uses: actions/checkout@v4
@@ -22,10 +43,17 @@ jobs:
2243
pip install -r requirements.txt
2344
pip install black pytest
2445
46+
- name: Wait for Postgres and Redis to be healthy
47+
run: |
48+
sleep 5
49+
2550
- name: Check code formatting with Black
2651
run: |
27-
black --check src tests
52+
black --check .
2853
2954
- name: Run tests with pytest
55+
env:
56+
DATABASE_URL: postgresql://myuser:mypassword@localhost:5445/mydatabase
57+
CELERY_BROKER_URL: redis://localhost:6370/0
3058
run: |
3159
PYTHONPATH=src pytest

0 commit comments

Comments
 (0)