-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (37 loc) · 1.52 KB
/
Makefile
File metadata and controls
53 lines (37 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
.PHONY: build bash install update cs
DOCKER_COMPOSE=docker compose
PHP_CS_FIXER=./vendor/bin/php-cs-fixer
RECTOR=./tools/bin/rector
GREEN := \033[0;32m
BLUE := \033[1;34m
NC := \033[0m
help:
@echo ""
@echo "$(BLUE)Available commands:$(NC)"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " $(GREEN)%-15s$(NC) %s\n", $$1, $$2}'
@echo ""
build: ## Build PHP service (Docker)
COMPOSE_BAKE=true $(DOCKER_COMPOSE) build
bash: ## Enter php container
$(DOCKER_COMPOSE) run -it --rm php bash
install: ## Install project dependencies
$(DOCKER_COMPOSE) run --rm php composer install
update: ## Update project dependencies
$(DOCKER_COMPOSE) run --rm php composer update
cs_fix: ## Run PHP CS Fixer
$(DOCKER_COMPOSE) run --rm php $(PHP_CS_FIXER) fix
cs_check: ## Run PHP CS Fixer (dry run)
$(DOCKER_COMPOSE) run --rm php $(PHP_CS_FIXER) check --diff
test: ## Run testsuite (PHPUnit)
$(DOCKER_COMPOSE) run --rm php ./vendor/bin/phpunit
coverage: ## Run testsuite (PHPUnit) with HTML coverage
$(DOCKER_COMPOSE) run --rm -e XDEBUG_MODE=coverage php ./vendor/bin/phpunit --coverage-html build/coverage
phpstan: ## Run PHPStan
$(DOCKER_COMPOSE) run --rm php ./vendor/bin/phpstan analyse
phpstan-baseline: ## Run PHPStan (with baseline generation)
$(DOCKER_COMPOSE) run --rm php ./vendor/bin/phpstan analyse -b
rector: ## Run Rector (dry run)
$(DOCKER_COMPOSE) run --rm php $(RECTOR) --dry-run
rectify: ## Run Rector
$(DOCKER_COMPOSE) run --rm php $(RECTOR)
quality: rectify cs_fix test