-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
69 lines (50 loc) · 1.81 KB
/
Makefile
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
65
66
67
68
69
DOCKER = @docker
DOCKER_COMPOSE = @docker-compose
PHP = $(DOCKER_COMPOSE) run --rm php
.DEFAULT_GOAL := help
help:
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
##
## Project
##---------------------------------------------------------------------------
.PHONY: boot up down vendor
boot: ## Launch the project
boot: up vendor
up: ## Up the containers
up: docker-compose.yml
$(DOCKER_COMPOSE) up -d --remove-orphans
down: ## Down the containers
down: docker-compose.yml
$(DOCKER_COMPOSE) down
vendor: ## Install the dependencies
vendor: composer.json composer.lock
$(PHP) composer install
##
## Tools
##---------------------------------------------------------------------------
.PHONY: php-cs-fixer php-cs-fixer-dry phpstan rector-dry rector
php-cs-fixer: ## Run PHP-CS-FIXER and fix the errors
php-cs-fixer:
$(PHP) vendor/bin/php-cs-fixer fix .
php-cs-fixer-dry: ## Run PHP-CS-FIXER in --dry-run mode
php-cs-fixer-dry:
$(PHP) vendor/bin/php-cs-fixer fix . --dry-run
phpstan: ## Run PHPStan (the configuration must be defined in phpstan.neon)
phpstan: phpstan.neon
$(DOCKER) run --rm -v $(PWD):/app phpstan/phpstan analyse /app/src
rector-dry: ## Run Rector in --dry-run mode
rector-dry: rector.php
$(PHP) vendor/bin/rector process --dry-run --config rector.php
rector: ## Run Rector
rector: rector.php
$(PHP) vendor/bin/rector process --config rector.php
##
## Tests
##---------------------------------------------------------------------------
.PHONY: tests infection
tests: ## Launch the PHPUnit tests
tests: phpunit.xml.dist
$(PHP) vendor/bin/phpunit tests
infection: ## Launch Infection
infection: infection.json.dist
$(PHP) vendor/bin/infection --min-covered-msi=90 --min-msi=80