feat: add linters and tests from CI to Makefile using the development environment
Backend / Lint i formatowanie (pull_request) Successful in 17s
Backend / Testy i kontrakt API (pull_request) Successful in 26s
Backend / Testowy build obrazu (pull_request) Failing after 1m27s

This commit is contained in:
mmacierzanka committed 2026-10-01 16:16:57 +02:00
1 parent 3e77e2d072
commit e2f6b1e71a
1 file changed
+31 -1
+31 -1
View File
@@ -1,4 +1,4 @@
.PHONY: check-docker migrate migration-rollback
.PHONY: check-docker lint-back format-back lint-front typecheck-front test-back test-front check test migrate migration-rollback
check-docker:
@command -v docker >/dev/null 2>&1 || { echo "Docker nie jest zainstalowany lub nie ma go w PATH." >&2; exit 1; }
@@ -6,6 +6,36 @@ check-docker:
MIGRATION_RUNNER = zyrarbot.storage.adapters.postgres.migration_runner
define run_in_dev
@if docker compose ps --status running --services | grep -qx '$(1)'; then \
docker compose exec -T $(1) $(2); \
else \
docker compose run --build --rm $(1) $(3); \
fi
endef
lint-back: check-docker
$(call run_in_dev,discord-bot,ruff check --fix .,ruff check --fix .)
format-back: check-docker
$(call run_in_dev,discord-bot,ruff format .,ruff format .)
lint-front: check-docker
$(call run_in_dev,frontend,npm run lint:fix,sh -c 'test -x node_modules/.bin/eslint || npm ci; npm run lint:fix')
typecheck-front: check-docker
$(call run_in_dev,frontend,npm run typecheck,sh -c 'test -x node_modules/.bin/vue-tsc || npm ci; npm run typecheck')
test-back: check-docker
$(call run_in_dev,discord-bot,pytest,pytest)
test-front: check-docker
$(call run_in_dev,frontend,npm run smoke,sh -c 'test -x node_modules/.bin/eslint || npm ci; npm run smoke')
check: lint-back format-back lint-front typecheck-front
test: test-back test-front
migrate: check-docker
docker compose run --build --rm discord-bot python -m $(MIGRATION_RUNNER) migrate