generated from spawnia/php-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (32 loc) · 1.23 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
.PHONY: it
it: fix stan test ## Run the commonly used targets
.PHONY: help
help: ## Displays this list of targets with descriptions
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'
setup: vendor ## Set up the repository
.PHONY: coverage
coverage: vendor ## Collects coverage from running unit tests with phpunit
mkdir --parents .build/phpunit
vendor/bin/phpunit --dump-xdebug-filter=.build/phpunit/xdebug-filter.php
vendor/bin/phpunit --coverage-text --prepend=.build/phpunit/xdebug-filter.php
.PHONY: fix
fix: rector php-cs-fixer
.PHONY: rector
rector: vendor
vendor/bin/rector process
.PHONY: php-cs-fixer
php-cs-fixer:
mkdir --parents .build/php-cs-fixer
vendor/bin/php-cs-fixer fix --cache-file=.build/php-cs-fixer/cache
.PHONY: stan
stan: vendor ## Runs a static analysis with phpstan
mkdir --parents .build/phpstan
vendor/bin/phpstan analyse --configuration=phpstan.neon
.PHONY: test
test: vendor ## Runs auto-review, unit, and integration tests with phpunit
mkdir --parents .build/phpunit
vendor/bin/phpunit --cache-directory=.build/phpunit
vendor: composer.json
composer validate --strict
composer install
composer normalize