Skip to content

Commit ec60ea1

Browse files
committed
Tweaked deployment tests to actually run with a db properly
1 parent a7e8654 commit ec60ea1

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/deploy.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,20 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12+
services:
13+
postgres:
14+
image: postgres:16
15+
env:
16+
POSTGRES_USER: postgres
17+
POSTGRES_PASSWORD: postgres
18+
POSTGRES_DB: test_db
19+
ports:
20+
- 5432:5432
21+
options: >-
22+
--health-cmd pg_isready
23+
--health-interval 10s
24+
--health-timeout 5s
25+
--health-retries 5
1226
steps:
1327
- uses: actions/checkout@v4
1428

@@ -25,6 +39,21 @@ jobs:
2539
cd backend
2640
uv sync
2741
42+
- name: Run migrations
43+
env:
44+
POSTGRES_SERVER: localhost
45+
POSTGRES_PORT: 5432
46+
POSTGRES_USER: postgres
47+
POSTGRES_PASSWORD: postgres
48+
POSTGRES_DB: test_db
49+
SECRET_KEY: test-secret-key-for-testing
50+
FIRST_SUPERUSER: [email protected]
51+
FIRST_SUPERUSER_PASSWORD: testpassword
52+
ENVIRONMENT: local
53+
run: |
54+
cd backend
55+
uv run alembic upgrade head
56+
2857
- name: Run tests
2958
env:
3059
PROJECT_NAME: Test Project

0 commit comments

Comments
 (0)