2626 "ghcr.io/wyrihaximusnet/php:${PHP_VERSION}-nts-alpine-slim-dev"
2727endif
2828
29+ ifneq (,$(findstring icrosoft,$(shell cat /proc/version) ) )
30+ THREADS =1
31+ else
32+ THREADS =$(shell nproc)
33+ endif
34+
2935all : # # Runs everything ###
3036 @grep -E ' ^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | grep -v " ###" | awk ' BEGIN {FS = ":.*?## "}; {printf "%s\n", $$1}' | xargs --open-tty $(MAKE )
3137
@@ -44,6 +50,20 @@ stan: ## Run static analysis (PHPStan)
4450psalm : # # Run static analysis (Psalm)
4551 $(DOCKER_RUN ) vendor/bin/psalm --threads=$(shell nproc) --shepherd --stats --config=./etc/qa/psalm.xml
4652
53+ unit-testing : # # Run tests
54+ $(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
55+ $(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
56+
57+ unit-testing-raw : # # Run tests ###
58+ php vendor/phpunit/phpunit/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
59+ 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
60+
61+ mutation-testing : # # Run mutation testing
62+ $(DOCKER_RUN ) vendor/bin/roave-infection-static-analysis-plugin --ansi --log-verbosity=all --threads=$(THREADS ) --psalm-config etc/qa/psalm.xml || (cat ./var/infection.log && false)
63+
64+ mutation-testing-raw : # # Run mutation testing ###
65+ php vendor/roave/infection-static-analysis-plugin/bin/roave-infection-static-analysis-plugin --ansi --log-verbosity=all --threads=$(THREADS ) --psalm-config etc/qa/psalm.xml || (cat ./var/infection.log && false)
66+
4767backward-compatibility-check : # # Check code for backwards incompatible changes
4868 $(DOCKER_RUN ) vendor/bin/roave-backward-compatibility-check || true
4969
@@ -56,17 +76,3 @@ task-list-ci: ## CI: Generate a JSON array of jobs to run, matches the commands
5676help : # # Show this help ###
5777 @printf " \033[33mUsage:\033[0m\n make [target]\n\n\033[33mTargets:\033[0m\n"
5878 @grep -E ' ^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf " \033[32m%-32s\033[0m %s\n", $$1, $$2}' | tr -d ' #'
59-
60- generate-example-clients : generate-example-client-one generate-example-client-subsplit generate-example-client-miele
61-
62- generate-example-client-one :
63- $(DOCKER_RUN ) php ./bin/openapi-client-generator ./example/openapi-client-one.yaml
64-
65- generate-example-client-subsplit :
66- $(DOCKER_RUN ) php ./bin/openapi-client-generator ./example/openapi-client-subsplit.yaml
67-
68- generate-example-client-miele :
69- $(DOCKER_RUN ) php ./bin/openapi-client-generator ./example/openapi-client-miele.yaml
70-
71- generate-test-client :
72- $(DOCKER_RUN ) php ./bin/openapi-client-generator ./tests/openapi-client-petstore.yaml
0 commit comments