-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (49 loc) · 2.13 KB
/
Makefile
File metadata and controls
64 lines (49 loc) · 2.13 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
54
55
56
57
58
59
60
61
62
63
64
.PHONY: help install update test test-coverage rector rector-dry lint validate clean all ci
# Colors for better readability
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
# Default target
.DEFAULT_GOAL := help
help: ## Show this help message
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " ${YELLOW}%-20s${GREEN}%s${RESET}\n", $$1, $$2}' $(MAKEFILE_LIST)
@echo ''
install: ## Install dependencies
@echo "${GREEN}Installing dependencies...${RESET}"
composer install
update: ## Update dependencies
@echo "${GREEN}Updating dependencies...${RESET}"
composer update
validate: ## Validate composer.json
@echo "${GREEN}Validating composer.json...${RESET}"
composer validate --strict
test: ## Run unit tests
@echo "${GREEN}Running tests...${RESET}"
vendor/bin/phpunit
test-coverage: ## Run tests with coverage report
@echo "${GREEN}Running tests with coverage...${RESET}"
XDEBUG_MODE=coverage vendor/bin/phpunit --coverage-html coverage --coverage-text
@echo "${YELLOW}Coverage report generated in coverage/index.html${RESET}"
rector: ## Apply Rector changes
@echo "${GREEN}Applying Rector changes...${RESET}"
vendor/bin/rector process
rector-dry: ## Show Rector changes without applying them
@echo "${GREEN}Showing Rector changes (dry-run)...${RESET}"
vendor/bin/rector process --dry-run
lint: ## Check PHP syntax
@echo "${GREEN}Checking PHP syntax...${RESET}"
@find . -name "*.php" -not -path "./vendor/*" -print0 | xargs -0 -n1 php -l
check: validate lint rector-dry ## Run all checks (validate, lint, rector-dry)
@echo "${GREEN}All checks completed!${RESET}"
clean: ## Clean generated files
@echo "${GREEN}Cleaning generated files...${RESET}"
rm -rf coverage .phpunit.cache vendor composer.lock
all: install check test ## Install, check and test
ci: install validate lint rector-dry test ## Run CI pipeline (install, validate, lint, rector-dry, test)
@echo "${GREEN}CI pipeline completed successfully!${RESET}"