Skip to content

Commit 76f5754

Browse files
committed
chore: update CI to use postgres for tests
1 parent d36fe25 commit 76f5754

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/backend-test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ jobs:
1010
backend-test:
1111
runs-on: ubuntu-latest
1212

13+
services:
14+
postgres:
15+
image: postgres:latest
16+
env:
17+
POSTGRES_USER: postgres
18+
POSTGRES_PASSWORD: postgres
19+
POSTGRES_DB: ocsl_test
20+
ports:
21+
- 5432:5432
22+
options: >-
23+
--health-cmd pg_isready
24+
--health-interval 10s
25+
--health-timeout 5s
26+
--health-retries 5
27+
1328
steps:
1429
- name: Checkout code
1530
uses: actions/checkout@v4
@@ -32,6 +47,11 @@ jobs:
3247
PYTHONPATH=backend:backend/src pytest backend/test -v --tb=long --junitxml=backend/test-results/junit.xml
3348
env:
3449
GOOGLE_MAPS_API_KEY: "test_api_key_not_used"
50+
POSTGRES_USER: postgres
51+
POSTGRES_PASSWORD: postgres
52+
POSTGRES_HOST: localhost
53+
POSTGRES_PORT: 5432
54+
POSTGRES_DB: ocsl_test
3555

3656
- name: Publish Test Results
3757
uses: EnricoMi/publish-unit-test-result-action@v2

0 commit comments

Comments
 (0)