-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (28 loc) · 1.58 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
PHP?=php8.1
COMPOSER=/usr/local/bin/composer
php-info:
@echo "Default PHP version: $(PHP) (Run with custom PHP version: make install PHP=php8.2).\n";
list: php-info ## List
@sed -rn 's/^([a-zA-Z_-]+):.*?## (.*)$$/"\1" "\2"/p' < $(MAKEFILE_LIST) | xargs printf "%-20s%s\n"
install: php-info ## Install dependencies (make install PHP=php8.0)
@if [ ! -d "vendor" ]; then $(PHP) $(COMPOSER) install; fi;
install-force: php-info ## Force install dependencies (make install PHP=php8.0)
$(PHP) $(COMPOSER) install
update: php-info ## Update dependencies
@$(PHP) $(COMPOSER) update
test: php-info install ## Run PHPUnit tests
$(PHP) vendor/bin/phpunit --configuration=phpunit.xml.dist --verbose
test-coverage: php-info install ## Run PHPUnit tests with coverage report
$(PHP) vendor/bin/phpunit --configuration=phpunit.xml.dist --verbose --coverage-text --coverage-html=tests/var/coverage
mutation-test: php-info install ## Run Infection mutation tests
$(PHP) vendor/bin/infection --threads=4 --show-mutations -vvv
code-style-fix: php-info install ## Fix code style
$(PHP) vendor/bin/php-cs-fixer fix --allow-risky=yes --diff
psalm: php-info install ## Run Psalm check
$(PHP) vendor/bin/psalm --config=psalm.xml.dist --threads=4 --show-snippet=true --show-info=true
rector: php-info install ## Run Rector
$(PHP) vendor/bin/rector process --clear-cache --dry-run
rector-fix: php-info install ## Run Rector
$(PHP) vendor/bin/rector process --clear-cache
.PHONY: php-info list install install-force update test test-coverage mutation-test code-style-fix psalm rector rector-fix
.DEFAULT_GOAL := list