forked from imDarshanGK/AI-dev-assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (61 loc) · 1.85 KB
/
Copy pathschema-tests.yml
File metadata and controls
72 lines (61 loc) · 1.85 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
name: Schema Smoke Tests
on:
push:
branches: [main, develop]
paths:
- "backend/app/models.py"
- "backend/app/database.py"
- "backend/app/services/database.py"
- "backend/tests/test_schema_smoke.py"
- ".github/workflows/schema-tests.yml"
pull_request:
branches: [main]
paths:
- "backend/app/models.py"
- "backend/app/database.py"
- "backend/app/services/database.py"
- "backend/tests/test_schema_smoke.py"
- ".github/workflows/schema-tests.yml"
jobs:
schema-smoke:
name: Schema Smoke Tests (PostgreSQL 16)
runs-on: ubuntu-latest
timeout-minutes: 10
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: smoke
POSTGRES_PASSWORD: smoke
POSTGRES_DB: smoke_db
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U smoke"
--health-interval 5s
--health-timeout 5s
--health-retries 10
defaults:
run:
working-directory: backend
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install libmagic
run: sudo apt-get update -qq && sudo apt-get install -y libmagic1 libmagic-dev
- name: Install dependencies
run: python -m pip install -r requirements.txt
- name: Install PostgreSQL driver
run: python -m pip install psycopg2-binary
- name: Run schema smoke tests
env:
DATABASE_URL: postgresql://smoke:smoke@localhost:5432/smoke_db
RATE_LIMIT_PER_MINUTE: 300
run: python -m pytest tests/test_schema_smoke.py -v --tb=short