diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh index bfe06786a0d6eea2e876ecf919aaa309ebe64564..d5752ee91699f9523085c167ffab7b35655d7608 100755 --- a/Build/Scripts/runTests.sh +++ b/Build/Scripts/runTests.sh @@ -57,7 +57,7 @@ No arguments: Run all unit tests with PHP 7.4 Options: -s <...> Specifies which test suite to run - - acceptance: backend acceptance tests + - acceptance: main backend acceptance tests - acceptancePagetree: backend acceptance tests for page tree - acceptanceInstallTool: acceptance tests for stand alone install tool - buildCss: execute scss to css builder @@ -79,6 +79,7 @@ Options: - composerInstallMax: "composer update", with no platform.php config. - composerInstallMin: "composer update --prefer-lowest", with platform.php set to PHP version x.x.0. - composerValidate: "composer validate" + - docBlockCheck: Scan php doc blocks for validity - fixCsvFixtures: fix broken functional test csv fixtures - functional: functional tests - install: installation acceptance tests, only with -d mariadb|postgres|sqlite @@ -86,6 +87,7 @@ Options: - lintScss: SCSS linting - lintTypescript: TS linting - lintHtml: HTML linting + - phpstan: phpstan tests - unit (default): PHP unit tests - unitDeprecated: deprecated PHP unit tests - unitJavascript: JavaScript unit tests @@ -507,6 +509,12 @@ case ${TEST_SUITE} in SUITE_EXIT_CODE=$? docker-compose down ;; + docBlockCheck) + setUpDockerComposeDotEnv + docker-compose run doc_block_check + SUITE_EXIT_CODE=$? + docker-compose down + ;; fixCsvFixtures) setUpDockerComposeDotEnv docker-compose run fix_csv_fixtures @@ -583,7 +591,7 @@ case ${TEST_SUITE} in ;; lint) setUpDockerComposeDotEnv - docker-compose run lint + docker-compose run lint_php SUITE_EXIT_CODE=$? docker-compose down ;; @@ -605,6 +613,12 @@ case ${TEST_SUITE} in SUITE_EXIT_CODE=$? docker-compose down ;; + phpstan) + setUpDockerComposeDotEnv + docker-compose run phpstan + SUITE_EXIT_CODE=$? + docker-compose down + ;; unit) setUpDockerComposeDotEnv docker-compose run unit diff --git a/Build/testing-docker/local/docker-compose.yml b/Build/testing-docker/local/docker-compose.yml index 483a435804c988c417b357c11038139d80111946..bc1fabd1852a9556a0a5c21099ab9d9bfca94ef4 100644 --- a/Build/testing-docker/local/docker-compose.yml +++ b/Build/testing-docker/local/docker-compose.yml @@ -640,6 +640,20 @@ services: composer validate; " + doc_block_check: + image: typo3gmbh/${DOCKER_PHP_IMAGE}:latest + user: ${HOST_UID} + volumes: + - ${CORE_ROOT}:${CORE_ROOT} + working_dir: ${CORE_ROOT} + command: > + /bin/sh -c " + if [ ${SCRIPT_VERBOSE} -eq 1 ]; then + set -x + fi + Build/Scripts/docBlockChecker.php; + " + functional_split: image: typo3gmbh/${DOCKER_PHP_IMAGE}:latest user: ${HOST_UID} @@ -913,7 +927,7 @@ services: fi " - lint: + lint_php: image: typo3gmbh/${DOCKER_PHP_IMAGE}:latest user: ${HOST_UID} volumes: @@ -984,6 +998,21 @@ services: node_modules/grunt/bin/grunt eslint; " + phpstan: + image: typo3gmbh/${DOCKER_PHP_IMAGE}:latest + user: ${HOST_UID} + volumes: + - ${CORE_ROOT}:${CORE_ROOT} + working_dir: ${CORE_ROOT} + command: > + /bin/sh -c " + if [ ${SCRIPT_VERBOSE} -eq 1 ]; then + set -x + fi + mkdir -p .cache + bin/phpstan analyse --no-progress --no-interaction --memory-limit 4G + " + unit: image: typo3gmbh/${DOCKER_PHP_IMAGE}:latest user: ${HOST_UID} diff --git a/phpstan.neon b/phpstan.neon index 261a9d94d35c9eba055cc9beb30eed684cbf811a..5cd6a9307c8d1f731c708077a8046d3fe2389747 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,6 +5,13 @@ includes: # - vendor/phpstan/phpstan/conf/bleedingEdge.neon parameters: + # Use local .cache dir instead of /tmp + tmpDir: .cache/phpstan + + parallel: + # Don't be overly greedy on machines with more CPU's to be a good neighbor especially on CI + maximumNumberOfProcesses: 5 + level: 2 # level 2 parameters which are set to opposite values in the original level 2 configuration. Parameters need to be