-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathMakefile
More file actions
116 lines (90 loc) · 4.01 KB
/
Makefile
File metadata and controls
116 lines (90 loc) · 4.01 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Run `make` (no arguments) to get a short description of what is available
# within this `Makefile`.
MKDOCS_IMAGE_ID := $(shell docker images -q laminas/mkdocs | xargs)
MDLINT_FILE = https://raw.githubusercontent.com/laminas/laminas-continuous-integration-action/refs/heads/1.43.x/setup/markdownlint/markdownlint.json
help: ## shows this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_\-\.]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.PHONY: help
documentation-theme: ## fetch the documentation theme repo
git clone git@github.com:laminas/documentation-theme.git
build-mkdocs-image: documentation-theme ## Build the mkdocs image with necessary dependencies for building the docs
$(if ${MKDOCS_IMAGE_ID}, $(info Image already built), cd documentation-theme/builder && docker build -t laminas/mkdocs .)
.PHONY: build-mkdocs-image
docs: build-mkdocs-image ## build the docs using a Docker container
docker run -it -w /app -v ${PWD}:/app --rm laminas/mkdocs ./documentation-theme/build.sh -u https://www.example.com
$(info ${PWD}/docs/html/index.html)
.PHONY: docs
docs-lint: .markdownlint.json ## Lint documentation
docker run -it -w /app -v ${PWD}:/app --rm davidanson/markdownlint-cli2 "docs/**/*.md" "README.md"
.PHONY: docs-lint
.markdownlint.json: ## Fetch the most recent settings for Markdown lint
curl -o .markdownlint.json ${MDLINT_FILE}
install: install-tools ## Install PHP dependencies
composer install
.PHONY: install
install-tools: ## Install standalone dev tools
cd tools/crc && composer install
cd tools/infection && composer install
cd tools/rector && composer install
.PHONY: install-tools
update: ## Update PHP dependencies
composer update
.PHONY: update
bump: bump-tools ## Bump dev dependencies and update
composer update && composer bump -D && composer update
.PHONY: bump
bump-tools: ## Bump and update standalone dev tools
cd tools/crc && composer update && composer bump -D && composer update
cd tools/infection && composer update && composer bump && composer update
cd tools/rector && composer update && composer bump && composer update
.PHONY: bump-tools
clean: ## Clear out caches and documentation assets
rm -rf documentation-theme
rm -rf docs/html
$(if ${MKDOCS_IMAGE_ID}, docker image rm laminas/mkdocs, echo "Skip image removal" )
rm -rf .phpunit.cache
rm -f .phpcs-cache
vendor/bin/psalm --clear-cache
rm -f .markdownlint.json
rm -f vendor/bin/composer-unused
.PHONY: clean
sa: ## Run static analysis checks
vendor/bin/psalm --no-cache
.PHONY: sa
cs: ## Run coding standards checks
vendor/bin/phpcs
.PHONY: cs
test: ## Run unit tests
vendor/bin/phpunit
.PHONY: test
mutants: ## Run mutation tests
tools/infection/vendor/bin/roave-infection-static-analysis-plugin \
--configuration=.infection.json5.dist \
--psalm-config=psalm.xml.dist
.PHONY: mutants
composer-validate: ## Validate composer.json and lock
composer validate --strict
.PHONY: composer-validate
composer-require-checker: ## Check for symbols from un-declared dependencies
tools/crc/vendor/bin/composer-require-checker check --config-file=tools/crc/config.json
.PHONY: composer-require-checker
qa: composer-validate cs sa test composer-require-checker docs-lint rector ## Run all QA Checks
.PHONY: qa
rector: ## Run Rector and show the diff
tools/rector/vendor/bin/rector process --dry-run -c tools/rector/rector.php
.PHONY: rector
rector-ci: ## Run Rector and show the diff in GitHub format for CI
tools/rector/vendor/bin/rector process --dry-run --output-format=github -c tools/rector/rector.php
.PHONY: rector
rector-fix: ## Apply Rector changes
tools/rector/vendor/bin/rector process -c tools/rector/rector.php
.PHONY: rector-fix
vendor/bin/composer-unused:
curl -sSL https://github.com/composer-unused/composer-unused/releases/latest/download/composer-unused.phar -o vendor/bin/composer-unused
chmod +x vendor/bin/composer-unused
unused: vendor/bin/composer-unused
vendor/bin/composer-unused
.PHONY: unused
unused-ci: vendor/bin/composer-unused
vendor/bin/composer-unused --output-format=github
.PHONY: unused-ci