forked from jobcloud/php-kafka-lib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (52 loc) · 1.97 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
59
60
61
62
63
64
65
.PHONY: clean code-style coverage help test static-analysis install-dependencies install-dependencies-lowest update-dependencies pcov-enable pcov-disable infection-testing
.DEFAULT_GOAL := test
PHPUNIT = ./vendor/bin/phpunit -c ./phpunit.xml
PHPSTAN = ./vendor/bin/phpstan
PHPCS = ./vendor/bin/phpcs --extensions=php
CONSOLE = ./bin/console
INFECTION = ./vendor/bin/infection
clean:
rm -rf ./build ./vendor
code-style: pcov-disable
mkdir -p build/logs/phpcs
${PHPCS} --report-full --report-gitblame --standard=PSR12 ./src --exclude=Generic.Commenting.Todo --report-junit=build/logs/phpcs/junit.xml
coverage: pcov-enable
${PHPUNIT} && ./vendor/bin/coverage-check clover.xml 100
test: pcov-disable
${PHPUNIT}
static-analysis: pcov-disable
mkdir -p build/logs/phpstan
${PHPSTAN} analyse --no-progress
update-dependencies:
composer update
install-dependencies:
composer install
install-dependencies-lowest:
composer install --prefer-lowest
infection-testing:
make coverage
cp -f build/logs/phpunit/junit.xml build/logs/phpunit/coverage/junit.xml
sudo php-ext-disable pcov
${INFECTION} --coverage=build/logs/phpunit/coverage --min-msi=91 --threads=`nproc`
sudo php-ext-enable pcov
pcov-enable:
sudo php-ext-enable pcov
pcov-disable:
sudo php-ext-disable pcov
help:
# Usage:
# make <target> [OPTION=value]
#
# Targets:
# clean Cleans the coverage and the vendor directory
# code-style Check codestyle using phpcs
# coverage Generate code coverage (html, clover)
# help You're looking at it!
# test (default) Run all the tests with phpunit
# static-analysis Run static analysis using phpstan
# infection-testing Run infection/mutation testing
# install-dependencies Run composer install
# install-dependencies-lowest Run composer install with --prefer-lowest
# update-dependencies Run composer update
# pcov-enable Enable pcov
# pcov-disable Disable pcov