-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
107 lines (81 loc) · 2.64 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# no buildin rules and variables
MAKEFLAGS =+ -rR --warn-undefined-variables
.PHONY: composer-install composer-update phpstan cs-fixer examples docker run
ifndef CONFLUENT_VERSION
CONFLUENT_VERSION := latest
endif
ifndef CONFLUENT_NETWORK_SUBNET
CONFLUENT_NETWORK_SUBNET := 172.68.0.0/24
endif
ifndef SCHEMA_REGISTRY_IPV4
SCHEMA_REGISTRY_IPV4 := 172.68.0.103
endif
ifndef KAFKA_BROKER_IPV4
KAFKA_BROKER_IPV4 := 172.68.0.102
endif
ifndef ZOOKEEPER_IPV4
ZOOKEEPER_IPV4 := 172.68.0.101
endif
ifndef COMPOSER
COMPOSER := bin/composer.phar
endif
ifndef PHP
PHP := bin/php
endif
ifndef PHP_VERSION
PHP_VERSION := 7.1
endif
ifndef XDEBUG_VERSION
XDEBUG_VERSION := 2.6.1
endif
-include variables.mk
export
docker:
docker build \
--build-arg PHP_VERSION=$(PHP_VERSION) \
--build-arg XDEBUG_VERSION=$(XDEBUG_VERSION) \
-t avro-serializer-php:$(PHP_VERSION) \
-f Dockerfile \
.
composer-install:
PHP_VERSION=$(PHP_VERSION) $(PHP) $(COMPOSER) install --no-interaction --no-progress --no-suggest --no-scripts
composer-update:
PHP_VERSION=$(PHP_VERSION) $(PHP) $(COMPOSER) update --no-interaction --no-progress --no-suggest --no-scripts
phpstan:
PHP_VERSION=$(PHP_VERSION) $(PHP) vendor/bin/phpstan.phar analyse -l 7 src
cs-fixer:
PHP_VERSION=$(PHP_VERSION) $(PHP) bin/php-cs-fixer.phar fix --config=.php_cs.dist -v --dry-run \
--path-mode=intersection --allow-risky=yes src test
cs-fixer-modify:
PHP_VERSION=$(PHP_VERSION) $(PHP) bin/php-cs-fixer.phar fix --config=.php_cs.dist -v \
--path-mode=intersection --allow-risky=yes src test
phpunit:
PHP_VERSION=$(PHP_VERSION) $(PHP) vendor/bin/phpunit
coverage:
mkdir -p build
PHP_VERSION=$(PHP_VERSION) $(PHP) vendor/bin/phpunit --coverage-clover=build/coverage.clover --coverage-text
PHP_VERSION=$(PHP_VERSION) $(PHP) bin/ocular.phar code-coverage:upload --format=php-clover \
--repository=g/flix-tech/avro-serde-php build/coverage.clover
run:
PHP_VERSION=$(PHP_VERSION) $(PHP) $(ARGS)
ci-local: cs-fixer phpstan phpunit
examples:
PHP_VERSION=$(PHP_VERSION) $(PHP) examples/*
install-phars:
curl http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar -o bin/php-cs-fixer.phar -LR -z bin/php-cs-fixer.phar
chmod a+x bin/php-cs-fixer.phar
curl https://scrutinizer-ci.com/ocular.phar -o bin/ocular.phar -LR -z bin/ocular.phar
chmod a+x bin/ocular.phar
platform:
docker-compose down
docker-compose up -d
sleep 15
clean:
rm -rf build
docker-compose down
benchmark:
docker-compose down
docker-compose up -d
sleep 15
PHP_VERSION=$(PHP_VERSION) $(PHP) ./vendor/bin/phpbench run benchmarks/AvroEncodingBench.php --report=aggregate --retry-threshold=5
docker-compose down