Skip to content

Commit 68b0dd1

Browse files
committed
update ci build/test setup
1 parent 240b257 commit 68b0dd1

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

.github/workflows/build_test_and_lint.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,19 @@ jobs:
3636
-e DATABASE_URL=postgres://testuser:testpassword@localhost:5432/testdb \
3737
--network host \
3838
intbot \
39-
make test
39+
make in-container/tests
4040
4141
services:
4242
postgres:
4343
image: postgres:16.4
4444
env:
45-
POSTGRES_USER: testuser
46-
POSTGRES_PASSWORD: testpassword
47-
POSTGRES_DB: testdb
45+
POSTGRES_USER: intbot_user
46+
POSTGRES_PASSWORD: intbot_password
47+
POSTGRES_DB: intbot_database_test
4848
ports:
49-
- 5432:5432
49+
- 14672:5432
5050
options: >-
51-
--health-cmd="pg_isready -U testuser -d testdb"
51+
--health-cmd="pg_isready -U intbot_user -d intbot_database_test"
5252
--health-interval=10s
5353
--health-timeout=5s
5454
--health-retries=5

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ UV_RUN_DEV=cd intbot && DJANGO_ENV="dev" uv run
77

88
# Docker
99
DOCKER_RUN_WITH_PORT=docker run -p 4672:4672 --add-host=host.internal:host-gateway -e DJANGO_ENV="local_container" -it intbot:$(V)
10+
DOCKER_RUN=docker run --add-host=host.internal:host-gateway -e DJANGO_ENV="test" -it intbot:$(V)
1011
MANAGE=cd intbot && ./manage.py
12+
# In container we run with migrations
13+
CONTAINER_TEST_CMD=DJANGO_SETTINGS_MODULE="intbot.settings" DJANGO_ENV="test" pytest --migrations
1114

1215
# Deployment
1316
DEPLOY_CMD=cd deploy && uvx --from "ansible-core" ansible-playbook -i hosts.yml
@@ -108,6 +111,9 @@ in-container/migrate:
108111
in-container/manage:
109112
$(MANAGE) $(ARG)
110113

114+
in-container/tests:
115+
$(CONTAINER_TEST_CMD) -vvv
116+
111117

112118
# Docker management targets
113119
# =========================
@@ -118,6 +124,9 @@ docker/build:
118124
docker/run/gunicorn:
119125
$(DOCKER_RUN_WITH_PORT) make in-container/gunicorn
120126

127+
docker/run/tests:
128+
$(DOCKER_RUN) make in-container/tests
129+
121130

122131
# Deploymenet targets
123132
# ====================

0 commit comments

Comments
 (0)