-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (22 loc) · 1.13 KB
/
Copy pathMakefile
File metadata and controls
32 lines (22 loc) · 1.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
.PHONY:help cs csfix test testcoverage testcoveragehtml clean
.DEFAULT_GOAL=help
PHP?=php
help:
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
composer.phar:
@curl -sS https://getcomposer.org/installer | $(PHP) -- --filename=composer.phar
@chmod +x composer.phar
vendor: composer.phar composer.json
@$(PHP) composer.phar install --no-interaction --optimize-autoloader
cs: vendor ## Check for coding standards
@$(PHP) vendor/bin/phpcs
csfix: vendor ## Check and fix for coding standards
@$(PHP) vendor/bin/phpcbf
test: vendor phpunit.xml ## Unit testing
@$(PHP) vendor/bin/phpunit --stop-on-failure
testcoverage: composer.phar vendor phpunit.xml ## Unit testing with code coverage
@XDEBUG_MODE=coverage $(PHP) vendor/bin/phpunit --coverage-text
testcoveragehtml: composer.phar vendor phpunit.xml ## Unit testing with code coverage in HTML
@XDEBUG_MODE=coverage $(PHP) vendor/bin/phpunit --coverage-html coverage
clean: ## Remove files needed for tests
@rm -rf composer.phar composer.lock vendor testbench coverage .phpunit.result.cache .phpunit.cache