-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
95 lines (75 loc) · 2.03 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
PHP=php
COMPOSER=composer
SYMFONY=symfony
.PHONY: test
test: composer-dump monorepo-validate phpstan psalm phpunit
.PHONY: composer-dump
composer-dump:
$(COMPOSER) dump-autoload
.PHONY: phpstan
phpstan:
$(PHP) vendor/bin/phpstan analyse
.PHONY: psalm
psalm:
$(PHP) vendor/bin/psalm
.PHONY: phpunit
phpunit:
$(eval c ?=)
make fixtures
$(PHP) vendor/bin/phpunit $(c)
.PHONY: lint
lint:
$(PHP) tests/bin/console lint:container
.PHONY: rector
rector:
$(PHP) vendor/bin/rector process > rector.log
make php-cs-fixer
.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: doctrine
doctrine:
rm -f tests/var/data.db
$(PHP) tests/bin/console doctrine:schema:create
$(PHP) tests/bin/console doctrine:fixtures:load --no-interaction
.PHONY: fixtures
fixtures:
rm -f tests/var/data.db
sqlite3 tests/var/data.db < tests/data.sql
.PHONY: serve
serve:
$(PHP) tests/bin/console cache:clear
$(PHP) tests/bin/console asset:install tests/public/
cd tests && sh -c "$(SYMFONY) server:start --document-root=public"
.PHONY: monorepo
monorepo: monorepo-validate monorepo-merge
.PHONY: monorepo-validate
monorepo-validate:
vendor/bin/monorepo-builder validate
.PHONY: monorepo-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: clean
clean:
rm -rf tests/var/cache/*
$(PHP) vendor/bin/psalm --clear-cache
.PHONY: sqlite
sqlite:
sqlite3 tests/var/data.db
.PHONY: sqlite-dump
sqlite-dump:
sqlite3 tests/var/data.db .dump > tests/data.sql
.PHONY: dump
dump:
$(PHP) tests/bin/console server:dump