forked from GwendolenLynch/msgphp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (75 loc) · 2.57 KB
/
Copy pathMakefile
File metadata and controls
83 lines (75 loc) · 2.57 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
ifndef PHP
PHP=7.2
endif
ifndef PHPUNIT
PHPUNIT=7.5
endif
dockerized=docker run --init -it --rm \
-u $(shell id -u):$(shell id -g) \
-v $(shell pwd):/app \
-w /app
qa=${dockerized} \
-e COMPOSER_CACHE_DIR=/app/var/composer \
-e SYMFONY_PHPUNIT_DIR=/app/var/phpunit \
-e SYMFONY_PHPUNIT_VERSION=${PHPUNIT} \
jakzal/phpqa:php${PHP}-alpine
mkdocs=${dockerized} -p 8000:8000 squidfunk/mkdocs-material
composer_args=--prefer-dist --no-progress --no-interaction --no-suggest
# deps
install: phpunit-install
${qa} composer install ${composer_args}
update: phpunit-install
${qa} composer update ${composer_args}
install-standalone:
${qa} bin/package-exec composer install ${composer_args}
update-standalone:
${qa} bin/package-exec composer update ${composer_args}
update-standalone-lowest:
${qa} bin/package-exec composer update ${composer_args} --prefer-stable --prefer-lowest
# tests
phpunit-install:
${qa} bin/package-exec simple-phpunit install
phpunit:
${qa} bin/package-exec simple-phpunit
phpunit-coverage:
${qa} bin/package-exec phpdbg -qrr /tools/simple-phpunit --coverage-clover=coverage.xml
# code style / static analysis
cs:
${qa} php-cs-fixer fix --dry-run --verbose --diff
cs-fix:
${qa} php-cs-fixer fix
sa: install
mkdir -p $$(find src/ -mindepth 1 -maxdepth 1 -type d -print -quit)/vendor
${qa} phpstan analyse
${qa} psalm --show-info=false
# docs
docs-serve:
${mkdocs}
docs-build:
${mkdocs} build --site-dir var/build/docs
# linting
lint-yaml:
${dockerized} sdesbure/yamllint yamllint .yamllint .*.yml *.yml
# CI
ci-install:
${qa} bin/package-exec composer require --no-update --quiet symfony/debug:^4.2.2
${qa} bin/ci-packager HEAD^ $$(find src/*/composer.json -type f -printf '%h\n')
# misc
clean:
rm -rf var/phpstan var/psalm var/php-cs-fixer.cache src/*/coverage.xml
smoke-test: clean update update-standalone phpunit cs sa
shell:
${qa} /bin/sh
link: install install-standalone
${qa} bin/package-exec composer link --working-dir=/app "\$$(pwd)"
test-project:
${qa} composer create-project --prefer-dist --no-progress --no-interaction symfony/skeleton var/test-project
${qa} composer config --working-dir=var/test-project extra.symfony.allow-contrib true
${qa} composer config --working-dir=var/test-project repositories.msgphp path "../../src/*"
${qa} composer require --no-update --working-dir=var/test-project ${composer_args} orm
${qa} composer require --working-dir=var/test-project --dev ${composer_args} debug maker server
composer-normalize: install install-standalone
${qa} composer normalize
${qa} bin/package-exec composer normalize
entrypoint:
echo "${qa}"