@@ -9,10 +9,14 @@ MAKEFLAGS += --no-print-directory
99# User-configurable variables (edit this)
1010# INFRA_SERVICES: long-running infra (db, broker, cache, ...)
1111# INFRA_INIT_SERVICES: one-shot services that prepare INFRA_SERVICES
12+ # MIGRATION_DB_SERVICE: transactional db service used by alembic (empty = no migrations)
13+ # STAIRWAY_TEST: path to stairway test (empty = skip stairway step)
1214# -----------------------------
1315PROJECT_NAME ?= $(notdir $(abspath .) )
1416INFRA_SERVICES ?= db_pg
1517INFRA_INIT_SERVICES ?=
18+ MIGRATION_DB_SERVICE ?= db_pg
19+ STAIRWAY_TEST ?= tests/integration/with_infra/test_stairway.py
1620
1721# -----------------------------
1822# Internal vars / aliases
@@ -24,6 +28,7 @@ DOCKER_ENV := scripts/makefile/docker_env.sh
2428LOCAL_ENV := scripts/makefile/local_env.sh
2529DOCKER_PRUNE := scripts/makefile/docker_prune.sh
2630PYCACHE_DEL := scripts/makefile/pycache_del.sh
31+ MIGRATION := scripts/makefile/migration.sh
2732DISHKA_PLOT_DATA := scripts/dishka/plot_dependencies_data.py
2833
2934# Test stack is isolated by project name
@@ -60,7 +65,7 @@ pip-audit:
6065 $(PIP_AUDIT )
6166
6267# Code quality
63- .PHONY : slotscheck lint test check
68+ .PHONY : slotscheck lint test check check-ci
6469slotscheck :
6570 $(SLOTSCHECK ) src
6671
8287check : lint test
8388 coverage html
8489
90+ check-ci :
91+ ruff check
92+ ruff format --check
93+ tombi format --check
94+ tombi lint
95+ deptry
96+ $(MAKE ) slotscheck
97+ lint-imports
98+ mypy
99+ pytest -v \
100+ $(PYTEST_PATHS_LIGHT ) \
101+ $(PYTEST_ARGS_COV )
102+ coverage html
103+
85104# Docker compose
86105.PHONY : docker-env local-env upd up upd-local up-local down stop-all
87106docker-env :
@@ -108,6 +127,14 @@ down:
108127stop-all :
109128 docker ps -q | xargs -r docker stop
110129
130+ # Migrations
131+ .PHONY : migration
132+ migration : local-env
133+ PROJECT_NAME=$(PROJECT_NAME ) \
134+ MIGRATION_DB_SERVICE=$(MIGRATION_DB_SERVICE ) \
135+ STAIRWAY_TEST=$(STAIRWAY_TEST ) \
136+ $(MIGRATION ) " $( msg) "
137+
111138# Tests (with infra)
112139.PHONY : test-docker
113140test-docker : docker-env
0 commit comments