This repository has been archived by the owner on Aug 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
126 lines (99 loc) · 4.23 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# VARIABLES
USER_ID := $(shell id -u)
GROUP_ID := $(shell id -g)
TOOLS_BIN := dev-ops/tools/vendor/bin
NODE_MODULES_ADMIN := src/Resources/app/administration/node_modules
PLATFORM_CONSOLE := ../../../bin/console
.DEFAULT_GOAL := help
help:
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help
static-analysis: | install-tools vendor ## runs psalm and phpstan and phpinsights
$(TOOLS_BIN)/psalm
$(TOOLS_BIN)/phpstan analyze --configuration phpstan.neon src
$(TOOLS_BIN)/phpinsights --no-interaction --min-quality=100 --min-complexity=75 --min-architecture=100 --min-style=100
.PHONY: static-analysis
psalm: | install-tools vendor ## runs psalm
$(TOOLS_BIN)/psalm --output-format=compact
.PHONY: psalm
phpstan: | install-tools vendor ## runs phpstan
$(TOOLS_BIN)/phpstan analyze --configuration phpstan.neon src
.PHONY: phpstan
php-insights: | install-tools vendor ## runs phpinsights
$(TOOLS_BIN)/phpinsights --no-interaction --min-quality=100 --min-complexity=75 --min-architecture=100 --min-style=100
.PHONY: php-insights
test: ## runs phpunit
composer dump-autoload
php -d pcov.enabled=1 -d pcov.directory=./src ../../../vendor/bin/phpunit \
--configuration phpunit.xml.dist \
--coverage-clover build/artifacts/phpunit.clover.xml \
--coverage-html build/artifacts/phpunit-coverage-html
.PHONY: test
test-fast: ## runs phpunit but skips all tests that lead to theme compilation
composer dump-autoload
php -d pcov.enabled=1 -d pcov.directory=./src ../../../vendor/bin/phpunit \
--configuration phpunit.xml.dist \
--coverage-clover build/artifacts/phpunit.clover.xml \
--coverage-html build/artifacts/phpunit-coverage-html \
--exclude ThemeCompile
.PHONY: test-fast
test-no-cov: ## runs phpunit
composer dump-autoload
php ../../../vendor/bin/phpunit --configuration phpunit.xml.dist
.PHONY: test-no-cov
ecs-dry: | install-tools vendor ## runs easy coding standard in dry mode
$(TOOLS_BIN)/ecs check .
.PHONY: ecs-dry
ecs-fix: | install-tools vendor ## runs easy coding standard and fixes issues
$(TOOLS_BIN)/ecs check . --fix
.PHONY: ecs-fix
init: ## activates the plugin and dumps test-db
- cd ../../../ \
&& ./psh.phar init \
&& php bin/console plugin:install --activate SaasConnect \
&& ./psh.phar storefront:init \
&& ./psh.phar init-test-databases \
&& ./psh.phar e2e:dump-db \
&& ./psh.phar cache
.PHONY: init
administration-unit: | administration-init ## run administration unit tests
npm --prefix src/Resources/app/administration run unit
.PHONY: administration-unit
administration-lint: | administration-init ## run eslint for administration
npm --prefix src/Resources/app/administration run eslint
.PHONY: administration-lint
administration-fix: | administration-init ## run eslint for administration
npm --prefix src/Resources/app/administration run eslint -- --fix
.PHONY: administration-fix
administration-init: | $(NODE_MODULES_ADMIN) ## install admin dependencies e.g. for tests
.PHONY: administration-init
$(NODE_MODULES_ADMIN):
npm --prefix src/Resources/app/administration install
install-tools: | $(TOOLS_BIN) ## Installs connect dev tooling
$(TOOLS_BIN):
composer install -d dev-ops/tools
vendor:
composer install --no-interaction --optimize-autoloader --no-suggest --no-scripts --no-progress
.PHONY: vendor
e2e-init: ## installs dependencies for e2e tests
npm --prefix src/Resources/app/e2e install
.PHONY: e2e-init
e2e-cli-proxy: ## starts an express server to add additional commands for e2e tests
npm --prefix src/Resources/app/e2e run start-e2e-proxy
.PHONY: e2e-cli-proxy
e2e-open: ## open cypress
- cd ../../../ && ./psh.phar cache --DB_NAME="shopware_e2e" --APP_ENV="prod"
- npm --prefix src/Resources/app/e2e run open
- cd ../../../ && ./psh.phar cache
.PHONY: e2e-open
build-assets: build-admin build-storefront ## builds all applications
.PHONY: build-assets
build-admin:
cd ../../../ && ./psh.phar administration:build
.PHONY: build-admin
build-storefront:
cd ../../../ && ./psh.phar storefront:build
.PHONY: build-storefront
verify-manifests: ## checks if all test manifest files are correct
find tests -regex .*[Mm]anifest.xml -exec $(PLATFORM_CONSOLE) app:verify {} \+
.PHONY: verify-manifests