Skip to content

Commit e9d4ca1

Browse files
committed
ci: run integration tests for FastAPI/Python/PostgreSQL
Part of #13
1 parent 64134c1 commit e9d4ca1

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

.github/workflows/integration-tests.yml

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ jobs:
4040
- docker-service-name: 'chi'
4141
database-service-name: 'mysql'
4242
application-port: 3030
43+
- docker-service-name: 'fastapi'
44+
database-service-name: 'postgres'
45+
application-port: 4040
4346
env:
4447
# Prevent interference between builds by setting the project name to a unique value. Otherwise
4548
# "docker compose down" has been stopping containers (especially database) from other builds.

docker/docker-compose.yaml

+23
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ services:
2727
retries: 10
2828
start_period: 1s
2929

30+
postgres:
31+
# https://hub.docker.com/_/postgres
32+
image: postgres:12-bookworm
33+
environment:
34+
- POSTGRES_USER=test
35+
- POSTGRES_PASSWORD=test
36+
- POSTGRES_DB=test
37+
volumes:
38+
- ./categories.postgres.sql:/docker-entrypoint-initdb.d/categories.sql
3039

3140
express-js:
3241
build: ../examples/js/express/mysql
@@ -69,3 +78,17 @@ services:
6978
depends_on:
7079
mysql:
7180
condition: service_healthy
81+
82+
fastapi:
83+
build: ../examples/python/fastapi/postgres
84+
environment:
85+
- DB_NAME=test
86+
- DB_USER=test
87+
- DB_PASSWORD=test
88+
- DB_HOST=postgres # defaults to localhost
89+
- PORT=4040 # defaults to 3000
90+
ports:
91+
- '4040:4040'
92+
depends_on:
93+
postgres:
94+
condition: service_healthy

0 commit comments

Comments
 (0)