generated from spawnia/php-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
47 lines (38 loc) · 1.37 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
.PHONY: it
it: fix stan approve test test-examples ## 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}'
.PHONY: fix
fix: vendor
vendor/bin/php-cs-fixer fix
.PHONY: stan
stan: ## Runs static analysis with phpstan
mkdir --parents .build/phpstan
vendor/bin/phpstan analyse --configuration=phpstan.neon
.PHONY: test
test: ## Runs tests with phpunit
mkdir --parents .build/phpunit
vendor/bin/phpunit
.PHONY: coverage
coverage: ## 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: approve
approve: ## Generate code and approve it as expected
tests/generate-and-approve-examples.php
.PHONY: test-examples
test-examples: ## Test examples
cd examples/custom-types && ./test.sh
cd examples/input && ./test.sh
cd examples/install && ./test.sh
cd examples/php-keywords && ./test.sh
cd examples/polymorphic && ./test.sh
cd examples/simple && ./test.sh
vendor: composer.json composer.lock
composer install
composer validate
composer normalize
composer.lock: composer.json
composer update