-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (61 loc) · 2.66 KB
/
Makefile
File metadata and controls
86 lines (61 loc) · 2.66 KB
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
.PHONY: up down build shell ensure-up install assets assets-test test test-coverage test-ts cs-check cs-fix phpstan rector rector-dry qa composer-sync release-check release-check-demos validate-translations clean update validate
COMPOSE_FILE ?= docker-compose.yml
COMPOSE ?= docker-compose -f $(COMPOSE_FILE)
SERVICE_PHP ?= php
up:
$(COMPOSE) build
$(COMPOSE) up -d
@sleep 3
$(COMPOSE) exec -T $(SERVICE_PHP) composer install --no-interaction
$(COMPOSE) exec -T -e CI=true $(SERVICE_PHP) pnpm install
down:
$(COMPOSE) down
build:
$(COMPOSE) build --no-cache
shell: ensure-up
$(COMPOSE) exec $(SERVICE_PHP) sh
ensure-up:
@if ! $(COMPOSE) exec -T $(SERVICE_PHP) true 2>/dev/null; then \
$(COMPOSE) up -d; sleep 3; \
$(COMPOSE) exec -T $(SERVICE_PHP) composer install --no-interaction; \
$(COMPOSE) exec -T -e CI=true $(SERVICE_PHP) pnpm install; \
fi
install: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) composer install
$(COMPOSE) exec -T -e CI=true $(SERVICE_PHP) pnpm install
assets: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) pnpm run build
test: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) composer test
test-coverage: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) composer test-coverage | tee coverage-php.txt
./.scripts/php-coverage-percent.sh coverage-php.txt
test-ts: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) pnpm run test:coverage | tee coverage-ts.txt
./.scripts/ts-coverage-percent.sh coverage-ts.txt
assets-test: test-ts
cs-check: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) composer cs-check
cs-fix: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) composer cs-fix
phpstan: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) composer phpstan
rector: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) composer rector
rector-dry: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) composer rector-dry
qa: cs-check test
composer-sync: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) composer validate --strict
$(COMPOSE) exec -T $(SERVICE_PHP) composer update --lock --no-install --no-interaction
release-check-demos:
@if [ -d demo ]; then $(MAKE) -C demo release-check; fi
release-check: ensure-up composer-sync cs-fix cs-check rector-dry phpstan test-coverage release-check-demos test-ts
clean:
rm -rf vendor coverage coverage-ts .phpunit.cache coverage-php.txt coverage-ts.txt
update: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) composer update --no-interaction
validate: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) composer validate --strict
validate-translations: ensure-up
$(COMPOSE) exec -T $(SERVICE_PHP) php -r 'require "vendor/autoload.php"; foreach (glob("src/Resources/translations/*.yaml") as $$f) { Symfony\Component\Yaml\Yaml::parseFile($$f); } echo "OK\n";'