|
24 | 24 | "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-nts-alpine3.12${SLIM_DOCKER_IMAGE}-dev"
|
25 | 25 | endif
|
26 | 26 |
|
| 27 | +ifneq (,$(findstring icrosoft,$(shell cat /proc/version))) |
| 28 | + THREADS=1 |
| 29 | +else |
| 30 | + THREADS=$(shell nproc) |
| 31 | +endif |
| 32 | + |
27 | 33 | all: ## Runs everything ###
|
28 | 34 | @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | grep -v "###" | awk 'BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE)
|
29 | 35 |
|
30 | 36 | syntax-php: ## Lint PHP syntax
|
31 | 37 | $(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .
|
32 | 38 |
|
33 | 39 | cs-fix: ## Fix any automatically fixable code style issues
|
34 |
| - $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(shell nproc) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml -vvvv |
| 40 | + $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(THREADS) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(THREADS) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml || $(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(THREADS) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml -vvvv |
35 | 41 |
|
36 | 42 | cs: ## Check the code for code style issues
|
37 |
| - $(DOCKER_RUN) vendor/bin/phpcs --parallel=$(shell nproc) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml |
| 43 | + $(DOCKER_RUN) vendor/bin/phpcs --parallel=$(THREADS) --cache=./var/.phpcs.cache.json --standard=./etc/qa/phpcs.xml |
38 | 44 |
|
39 | 45 | stan: ## Run static analysis (PHPStan)
|
40 | 46 | $(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c ./etc/qa/phpstan.neon
|
41 | 47 |
|
42 | 48 | psalm: ## Run static analysis (Psalm)
|
43 |
| - $(DOCKER_RUN) vendor/bin/psalm --threads=$(shell nproc) --shepherd --stats --config=./etc/qa/psalm.xml |
| 49 | + $(DOCKER_RUN) vendor/bin/psalm --threads=$(THREADS) --shepherd --stats --config=./etc/qa/psalm.xml |
44 | 50 |
|
45 | 51 | unit-testing: ## Run tests
|
46 | 52 | $(DOCKER_RUN) vendor/bin/phpunit --colors=always -c ./etc/qa/phpunit.xml --coverage-text --coverage-html ./var/tests-unit-coverage-html --coverage-clover ./var/tests-unit-clover-coverage.xml
|
47 | 53 | $(DOCKER_RUN) test -n "$(COVERALLS_REPO_TOKEN)" && test -n "$(COVERALLS_RUN_LOCALLY)" && test -f ./var/tests-unit-clover-coverage.xml && vendor/bin/php-coveralls -v --coverage_clover ./build/logs/clover.xml --json_path ./var/tests-unit-clover-coverage-upload.json || true
|
48 | 54 |
|
49 | 55 | mutation-testing: ## Run mutation testing
|
50 |
| - $(DOCKER_RUN) vendor/bin/roave-infection-static-analysis-plugin --ansi --min-msi=100 --min-covered-msi=100 --threads=$(shell nproc) --ignore-msi-with-no-mutations || (cat ./var/infection.log && false) |
| 56 | + $(DOCKER_RUN) vendor/bin/roave-infection-static-analysis-plugin --ansi --min-msi=100 --min-covered-msi=100 --threads=$(THREADS) --ignore-msi-with-no-mutations || (cat ./var/infection.log && false) |
51 | 57 |
|
52 | 58 | composer-require-checker: ## Ensure we require every package used in this package directly
|
53 | 59 | $(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=./etc/qa/composer-require-checker.json
|
|
0 commit comments