-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (43 loc) · 1.56 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
ROOT_DIR=$(shell pwd)/
TESTDIR=$(ROOT_DIR)/tests
PHPS=php -S 127.0.0.1:5000
PHPUNIT=vendor/bin/phpunit
INFECTION_VERSION=0.15.3
INFECTION_ARGS=
all: install clean tests
install:
composer update
tests: test-server run-phpunit psalm run-infection kill-test-server phpcs
coverage: PUARGS="--coverage-clover=coverage.xml"
coverage: tests-unit
tests-unit: test-server run-phpunit kill-test-server
run-phpunit:
@$(PHPUNIT) $(PUARGS)
psalm:
vendor/bin/psalm
psalm-ci:
vendor/bin/psalm --shepherd
test-server:
@echo -n "Starting embedded server"
$(eval SRV_PID=$(shell $(PHPS) $(TESTDIR)/server.php > /dev/null & echo $$!))
@echo " (PID $(SRV_PID))"
kill-test-server:
kill -SIGINT $(SRV_PID)
infection.phar:
wget --no-check-certificate "https://github.com/infection/infection/releases/download/$(INFECTION_VERSION)/infection.phar"
wget --no-check-certificate "https://github.com/infection/infection/releases/download/$(INFECTION_VERSION)/infection.phar.asc"
chmod +x infection.phar
infection: infection.phar test-server run-infection kill-test-server
infection-ci: INFECTION_ARGS=--logger-github --git-diff-filter=AM
infection-ci: INFECTION_VERSION=0.23.0
infection-ci: infection
phpcs:
vendor/bin/phpcs src/ --standard=psr12 --runtime-set ignore_warnings_on_exit true
run-infection: infection.phar
./infection.phar $(INFECTION_ARGS)
php80_shell:
docker-compose -f docker-compose.php80.yaml build
docker-compose -f docker-compose.php80.yaml run php bash
clean:
rm -f /tmp/test-db.sqlite
.PHONY: tests test-server clean install infection infection-ci psalm psalm-ci phpcs