-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
58 lines (46 loc) · 1.74 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
48
49
50
51
52
53
54
55
56
57
58
.PHONY: clean fix-code-style code-style coverage help test test-unit test-integration static-analysis infection-testing install-dependencies update-dependencies
.DEFAULT_GOAL := help
PHPSPEC = ./vendor/bin/phpspec run --format dot -vvv -c phpspec.yml
PHPSTAN = ./vendor/bin/phpstan analyse
PHPCS = ./vendor/bin/phpcs --extensions=php
PHPCBF = ./vendor/bin/phpcbf ./src --standard=PSR12
INFECTION = ./vendor/bin/infection
CONSOLE = ./bin/console
clean:
rm -rf ./build ./vendor
fix-code-style:
${PHPCBF}
code-style:
mkdir -p build/logs/phpcs
${PHPCS} --report-junit=build/logs/phpcs/junit.xml
coverage:
mkdir -p build/logs/phpspec/coverage
php -dpcov.enabled=1 -dpcov.directory=./src ${PHPSPEC}
./vendor/bin/coverage-check build/logs/phpspec/coverage/coverage.xml 98
test: test-unit test-integration
test-unit:
${PHPSPEC} --no-coverage
infection-testing:
make coverage
cp -f build/logs/phpspec/coverage/xml/index.xml build/logs/phpspec/coverage/junit.xml
${INFECTION} --test-framework=phpspec --only-covered --coverage=build/logs/phpspec/coverage --min-msi=88 --threads=`nproc`
static-analysis:
${PHPSTAN} src --no-progress
install-dependencies:
composer install
update-dependencies:
composer update
help:
# Usage:
# make <target> [OPTION=value]
#
# Targets:
# clean Cleans the coverage and the vendor directory
# code-style Check code style using phpcs
# coverage Generate code coverage (html, clover)
# help You're looking at it!
# test (default) Run all the tests
# test-unit Run the unit tests with phpspec
# static-analysis Run static analysis using phpstan
# install-dependencies Run composer install
# update-dependencies Run composer update