-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (32 loc) · 997 Bytes
/
Copy pathMakefile
File metadata and controls
46 lines (32 loc) · 997 Bytes
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
PHP ?= 8.4
SERVICE := php$(subst .,,$(PHP))
COMPOSE := $(shell docker compose version >/dev/null 2>&1 && echo "docker compose" || echo "docker-compose")
DC := $(COMPOSE) run --rm $(SERVICE)
.PHONY: build build-svc install update test test-coverage lint lint-fix analyse ci ci-full shell matrix clean
build:
$(COMPOSE) build
build-svc:
$(COMPOSE) build $(SERVICE)
install:
@rm -f composer.lock
$(DC) composer update --no-progress --prefer-dist
update:
$(DC) composer update
test:
$(DC) vendor/bin/phpunit
test-coverage:
$(DC) vendor/bin/phpunit --coverage-text --coverage-clover build/logs/clover.xml
lint:
$(DC) vendor/bin/phpcs --standard=PSR12 --ignore=Tests src/
lint-fix:
$(DC) vendor/bin/phpcbf --standard=PSR12 --ignore=Tests src/
analyse:
$(DC) vendor/bin/phpstan analyse --level=8 src/
ci: lint test
ci-full: lint analyse test
shell:
$(DC) bash
matrix:
@printf '8.1\n8.2\n8.3\n8.4\n8.5\n' | xargs -n1 -P5 -I{} $(MAKE) PHP={} install ci
clean:
$(COMPOSE) down -v