-
Notifications
You must be signed in to change notification settings - Fork 39
48 lines (40 loc) · 1.17 KB
/
tests.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
name: Python Unit Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main, dev ]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: pgvector/pgvector:pg16
env:
POSTGRES_HOST: localhost
POSTGRES_USER: ${{ secrets.DB_USER }}
PGUSER: ${{ secrets.DB_USER }}
POSTGRES_PASSWORD: ${{ secrets.DB_PASS }}
POSTGRES_DB: ${{ secrets.DB_NAME }}
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set Environment and Install Dependencies
uses: ./.github/actions/setup-env
- name: Test with pytest
run: poetry run pytest --cov .
env:
DB_USER: ${{ secrets.DB_USER }}
DB_PASS: ${{ secrets.DB_PASS }}
DB_NAME: ${{ secrets.DB_NAME }}
DB_PORT: 5432
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
RUN_ENV: local
PORT: 8080
DATABASE_URL: postgresql://${{ secrets.DB_USER }}:${{ secrets.DB_PASS }}@localhost:5432/${{ secrets.DB_NAME }}