-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
40 lines (28 loc) · 912 Bytes
/
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
.PHONY: default clean init phpcs phpcbf
DRUN=docker run --rm -v $(shell pwd):/app -w /app
RUN=${DRUN} php:7
COMPOSER=${DRUN} composer
COMPOSER_FLAGS=--no-ansi --no-interaction --no-progress --no-scripts --optimize-autoloader --prefer-dist
PHPUNIT=vendor/bin/phpunit
COVERAGE=phpdbg -qrr ${PHPUNIT} --coverage-html coverage --coverage-clover coverage/clover.xml
PHPCS=vendor/bin/phpcs src
default: vendor test
composer.lock: composer.json
${COMPOSER} update ${COMPOSER_FLAGS}
vendor: composer.lock
${COMPOSER} install ${COMPOSER_FLAGS}
.PHONY: test-% test test-fast test-coverage
test-%: vendor
${DRUN} php:$(@:test-%=%) ${PHPUNIT}
test: test-7.1 test-7.2 test-7.3 test-7.4
test-fast: vendor
${DRUN} php:7 ${PHPUNIT}
test-coverage: vendor
${RUN} ${COVERAGE}
clean:
${RUN} rm -rf vendor composer.lock
init: clean vendor
phpcs: vendor
${RUN} ${PHPCS}
phpcbf: vendor
${RUN} vendor/bin/phpcbf src