-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (58 loc) · 1.62 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
PHP=php
COMPOSER=composer
.PHONY: test
test: composer-dump phpstan psalm phpunit
.PHONY: composer-dump
composer-dump:
$(COMPOSER) dump-autoload --optimize
.PHONY: phpstan
phpstan:
$(PHP) vendor/bin/phpstan analyse
.PHONY: psalm
psalm:
$(PHP) vendor/bin/psalm
.PHONY: phpunit
phpunit:
$(eval c ?=)
$(PHP) vendor/bin/phpunit $(c)
.PHONY: php-cs-fixer
php-cs-fixer: tools/php-cs-fixer
$(PHP) $< fix --config=.php-cs-fixer.dist.php --verbose --allow-risky=yes
.PHONY: tools/php-cs-fixer
tools/php-cs-fixer:
phive install php-cs-fixer
.PHONY: rector
rector:
$(PHP) vendor/bin/rector process > rector.log
make php-cs-fixer
.PHONY: clean
clean:
$(PHP) vendor/bin/psalm --clear-cache
rm -rf tests/var/*
.PHONY: merge
monorepo-merge:
$(PHP) vendor/bin/monorepo-builder merge
.PHONY: monorepo-release-%
monorepo-release-%:
git update-index --really-refresh > /dev/null; git diff-index --quiet HEAD || (echo "Working directory is not clean, aborting" && exit 1)
[ `git branch --show-current` == main ] || (echo "Not on main branch, aborting" && exit 1)
$(PHP) vendor/bin/monorepo-builder release $*
git switch -c release/$*
git add .
git commit -m "release: $*"
.PHONY:
fixtures: tests/var/data.db
tests/var/data.db:
sqlite3 $@ < tests/etc/data.sql
.PHONY: fixtures-init
fixtures-dump:
rm tests/var/data.db
$(PHP) tests/bin/console doctrine:schema:create
$(PHP) tests/bin/console doctrine:fixtures:load --no-interaction
sqlite3 tests/var/data.db .dump > tests/etc/data.sql
.PHONY: dump
dump:
$(PHP) tests/bin/console server:dump
clear-cache:
$(PHP) vendor/bin/phpstan clear-result-cache
$(PHP) vendor/bin/psalm --clear-cache