-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (68 loc) · 2.71 KB
/
Copy pathMakefile
File metadata and controls
88 lines (68 loc) · 2.71 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
87
88
DOCKER := docker run --rm -v "$(PWD)":/app -w /app composer:2
DOCKER_HOST := docker run --rm --network host -v "$(PWD)":/app -w /app
PCOV_BOOTSTRAP := apk add --no-cache $$PHPIZE_DEPS >/dev/null && pecl install pcov >/dev/null && docker-php-ext-enable pcov
.PHONY: build bench cs cs-fix psalm test mutation rector rector-fix install normalize require-checker \
test-coverage test-coverage-ci update-deps release-check bc-check audit-package
install:
$(DOCKER) composer install --no-interaction --no-progress --prefer-dist
build:
$(DOCKER) composer build
bench:
$(DOCKER) composer bench
cs:
$(DOCKER) composer cs
cs-fix:
$(DOCKER) composer cs:fix
psalm:
$(DOCKER) composer psalm
test:
$(DOCKER) composer test
test-coverage:
$(DOCKER) sh -lc '$(PCOV_BOOTSTRAP) && composer test:coverage'
test-coverage-ci:
$(DOCKER) sh -lc '$(PCOV_BOOTSTRAP) && composer test:coverage:ci'
mutation:
$(DOCKER) sh -lc '$(PCOV_BOOTSTRAP) && composer mutation'
rector:
$(DOCKER) composer rector
rector-fix:
$(DOCKER) composer rector:fix
normalize:
$(DOCKER) sh -c 'git config --global --add safe.directory /app; composer normalize'
require-checker:
$(DOCKER) composer require-checker
update-deps:
$(DOCKER) sh -c 'git config --global --add safe.directory /app; composer update -q; composer normalize'
release-check:
$(DOCKER) composer release-check
$(MAKE) mutation
bc-check:
$(DOCKER) sh -c 'git config --global --add safe.directory "*"; \
LATEST=$$(git describe --tags --abbrev=0 2>/dev/null || true); \
if [ -n "$$LATEST" ]; then \
composer bc-check -- --from=$$LATEST; \
else \
echo "No previous tag - skipping BC check"; \
fi'
help:
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@echo " install composer install"
@echo " build full gate (validate + normalize + cs + psalm + test)"
@echo " cs check code style (dry-run)"
@echo " cs-fix fix code style"
@echo " psalm static analysis"
@echo " test run phpunit"
@echo " test-coverage run phpunit with coverage"
@echo " test-coverage-ci run phpunit coverage for CI artifacts"
@echo " mutation mutation testing"
@echo " rector check rector (dry-run)"
@echo " rector-fix apply rector fixes"
@echo " normalize normalize composer.json"
@echo " require-checker check composer dependencies"
@echo " update-deps composer update + normalize"
@echo " bc-check check backward compatibility against latest tag"
@echo " release-check build + rector + bc-check + mutation"
audit-package:
@if [ -f ../bin/package-audit ]; then bash ../bin/package-audit "$(CURDIR)"; else echo "package-audit: available only inside the monorepo"; fi