forked from tigitz/php-spellchecker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (49 loc) 路 2.18 KB
/
Copy pathMakefile
File metadata and controls
66 lines (49 loc) 路 2.18 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
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
DOCKER_COMPOSE ?= docker-compose
EXEC_PHP = $(DOCKER_COMPOSE) run --rm -T php$(PHP_VERSION)
PHP_VERSION ?= 7.3
DEPS ?= "LOCKED"
COMPOSER = $(EXEC_PHP) composer
WITH_COVERAGE ?= "FALSE"
build:
@$(DOCKER_COMPOSE) pull --parallel --ignore-pull-failures 2> /dev/null
$(DOCKER_COMPOSE) build php$(PHP_VERSION)
kill:
$(DOCKER_COMPOSE) kill
$(DOCKER_COMPOSE) down --volumes --remove-orphans
setup: ## Setup spellcheckers dependencies
setup: build
$(DOCKER_COMPOSE) up -d --remove-orphans --no-recreate languagetools
.PHONY: build kill setup
tests: ## Run all tests
tests:
if [ $(WITH_COVERAGE) = true ]; then $(EXEC_PHP) vendor/bin/phpunit --coverage-clover clover.xml; else $(EXEC_PHP) vendor/bin/phpunit; fi
tests-dox: ## Run all tests in dox format
tests-dox:
if [ $(WITH_COVERAGE) = true ]; then $(EXEC_PHP) vendor/bin/phpunit --coverage-clover clover.xml --testdox; else $(EXEC_PHP) vendor/bin/phpunit --testdox; fi
tu: ## Run unit tests
tu: vendor
$(EXEC_PHP) vendor/bin/phpunit --exclude-group integration
ti: ## Run functional tests
ti: vendor
$(EXEC_PHP) vendor/bin/phpunit --group integration
.PHONY: tests tests-dox tu ti
vendor:
if [ $(DEPS) = "LOWEST" ]; then $(COMPOSER) update --prefer-lowest; fi
if [ $(DEPS) = "LOCKED" ]; then $(COMPOSER) install; fi
if [ $(DEPS) = "HIGHEST" ]; then $(COMPOSER) update; fi
rector:
docker run -v $(pwd):/project rector/rector:latest bin/rector process /project/src/ --config vendor/thecodingmachine/safe/rector-migrate.yml --autoload-file /project/vendor/autoload.php
phpcs: vendor
$(EXEC_PHP) vendor/bin/phpcs
phpcbf: vendor
$(EXEC_PHP) vendor/bin/phpcbf
phpstan: vendor
$(EXEC_PHP) vendor/bin/phpstan analyse src tests -c phpstan.neon -a vendor/autoload.php
infection: vendor
$(EXEC_PHP) vendor/bin/phpunit --coverage-xml=build/coverage/coverage-xml --log-junit=build/coverage/phpunit.junit.xml
$(EXEC_PHP) php infection.phar --threads=4 --coverage=build/coverage --min-covered-msi=74
.PHONY: vendor php-cs php-cbf php-stan
.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/'
.PHONY: help