forked from openspout/openspout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (51 loc) · 1.47 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
SRCS := $(shell find ./src ./tests -type f -not -path "*/resources/generated_*")
LOCAL_BASE_BRANCH ?= $(shell git show-branch | sed "s/].*//" | grep "\*" | grep -v "$$(git rev-parse --abbrev-ref HEAD)" | head -n1 | sed "s/^.*\[//")
ifeq ($(strip $(LOCAL_BASE_BRANCH)),)
LOCAL_BASE_BRANCH := HEAD^
endif
BASE_BRANCH ?= $(LOCAL_BASE_BRANCH)
all: csfix static-analysis code-coverage
@echo "Done."
vendor: composer.json
composer update
composer bump
touch vendor
.PHONY: csfix
csfix: vendor
vendor/bin/php-cs-fixer fix --verbose
.PHONY: static-analysis
static-analysis: vendor
php -d zend.assertions=1 vendor/bin/phpstan analyse $(PHPSTAN_ARGS)
coverage/ok: vendor $(SRCS) Makefile phpunit.xml
chmod -fR u+rwX tests/resources/generated_* || true
rm -fr tests/resources/generated_*
(php \
-d zend.assertions=1 \
-d open_basedir="$(realpath .)" \
-d sys_temp_dir="$(realpath .)" \
vendor/bin/phpunit \
$(PHPUNIT_ARGS) \
&& touch $@)
.PHONY: test
test: coverage/ok
.PHONY: code-coverage
code-coverage: coverage/ok
echo "Base branch: $(BASE_BRANCH)"
php -d zend.assertions=1 \
vendor/bin/infection \
--threads=$(shell nproc) \
--git-diff-lines \
--git-diff-base=$(BASE_BRANCH) \
--skip-initial-tests \
--coverage=coverage \
--ignore-msi-with-no-mutations \
--show-mutations \
--verbose \
--min-msi=100 \
$(INFECTION_ARGS)
.PHONY: benchmark
benchmark: vendor
php -d zend.assertions=1 \
vendor/bin/phpbench run \
--report=default \
$(PHPBENCH_ARGS)