From 3055cd347728597fadac1c9c669caf2149a432a3 Mon Sep 17 00:00:00 2001 From: Torben Hansen Date: Sun, 17 Dec 2023 07:01:36 +0100 Subject: [PATCH] [TASK] Move all build configuration to .Build folder --- .../codeception}/AcceptanceTests.yml | 0 .Build/composer.json | 48 ++++++++++++++++ .Build/documentation/docker-compose.yml | 8 +++ .../php-cs-fixer/.php-cs-fixer.php | 2 +- .../phpstan/phpstan-baseline.neon | 20 +++---- phpstan.neon => .Build/phpstan/phpstan.neon | 4 +- .../phpunit}/FunctionalTests.xml | 2 +- {Tests/Build => .Build/phpunit}/UnitTests.xml | 2 +- .editorconfig | 56 ------------------- .github/workflows/AcceptanceTests.yml | 12 ++-- .github/workflows/CodeQuality.yml | 11 ++-- .github/workflows/UnitFunctionalTests.yml | 11 ++-- .gitignore | 6 +- Tests/Acceptance/README.md | 2 +- composer.json | 34 +---------- 15 files changed, 98 insertions(+), 120 deletions(-) rename {Tests/Build => .Build/codeception}/AcceptanceTests.yml (100%) create mode 100644 .Build/composer.json create mode 100644 .Build/documentation/docker-compose.yml rename .php-cs-fixer.dist.php => .Build/php-cs-fixer/.php-cs-fixer.php (98%) rename phpstan-baseline.neon => .Build/phpstan/phpstan-baseline.neon (70%) rename phpstan.neon => .Build/phpstan/phpstan.neon (78%) rename {Tests/Build => .Build/phpunit}/FunctionalTests.xml (94%) rename {Tests/Build => .Build/phpunit}/UnitTests.xml (95%) delete mode 100644 .editorconfig diff --git a/Tests/Build/AcceptanceTests.yml b/.Build/codeception/AcceptanceTests.yml similarity index 100% rename from Tests/Build/AcceptanceTests.yml rename to .Build/codeception/AcceptanceTests.yml diff --git a/.Build/composer.json b/.Build/composer.json new file mode 100644 index 000000000..d987441ae --- /dev/null +++ b/.Build/composer.json @@ -0,0 +1,48 @@ +{ + "name": "derhansen/sf_event_mgt_build", + "description": "composer.json for builds", + "repositories": [ + { + "type": "path", + "url": "../" + } + ], + "require": { + "derhansen/sf_event_mgt": "@dev", + "typo3/cms-core": "^12.4", + "php": ">=8.1" + }, + "require-dev": { + "typo3/cms-composer-installers": "^5.0", + "typo3/cms-backend": "^12.4", + "typo3/cms-frontend": "^12.4", + "typo3/cms-extbase": "^12.4", + "typo3/cms-felogin": "^12.4", + "typo3/cms-fluid-styled-content": "^12.4", + "typo3/cms-fluid": "^12.4", + "typo3/cms-tstemplate": "^12.4", + "typo3/cms-install": "^12.4", + "typo3/cms-extensionmanager": "^12.4", + "typo3/testing-framework": "^8.0.0 || dev-main", + "friendsofphp/php-cs-fixer": "^3.12.0", + "saschaegerer/phpstan-typo3": "^1.8.3", + "phpstan/extension-installer": "^1.1", + "jangregor/phpstan-prophecy": "^1.0", + "codeception/codeception": "^5.0", + "codeception/module-webdriver": "^4.0", + "ericmartel/codeception-email": "^1.0", + "codeception/module-db": "^3.1" + }, + "config": { + "allow-plugins": { + "typo3/class-alias-loader": true, + "typo3/cms-composer-installers": true, + "phpstan/extension-installer": true + } + }, + "autoload-dev": { + "psr-4": { + "DERHANSEN\\SfEventMgt\\Tests\\": "../Tests" + } + } +} diff --git a/.Build/documentation/docker-compose.yml b/.Build/documentation/docker-compose.yml new file mode 100644 index 000000000..e6db3a192 --- /dev/null +++ b/.Build/documentation/docker-compose.yml @@ -0,0 +1,8 @@ +version: '3' +services: + t3docmake: + image: ghcr.io/t3docs/render-documentation:latest + command: makehtml + volumes: + - ./:/PROJECT:ro + - ./Documentation-GENERATED-temp:/RESULT diff --git a/.php-cs-fixer.dist.php b/.Build/php-cs-fixer/.php-cs-fixer.php similarity index 98% rename from .php-cs-fixer.dist.php rename to .Build/php-cs-fixer/.php-cs-fixer.php index 3f8400aba..e157a2dca 100644 --- a/.php-cs-fixer.dist.php +++ b/.Build/php-cs-fixer/.php-cs-fixer.php @@ -64,7 +64,7 @@ ]) ->setFinder( PhpCsFixer\Finder::create() - ->in(__DIR__) + ->in(dirname(__DIR__ . '/../../../')) ->exclude(['.Build', 'Documentation', 'Resources']) ->notName('ext_emconf.php') ); diff --git a/phpstan-baseline.neon b/.Build/phpstan/phpstan-baseline.neon similarity index 70% rename from phpstan-baseline.neon rename to .Build/phpstan/phpstan-baseline.neon index b2bba4867..9bb6075c6 100644 --- a/phpstan-baseline.neon +++ b/.Build/phpstan/phpstan-baseline.neon @@ -3,50 +3,50 @@ parameters: - message: "#^Parameter \\#2 \\$optionKey of method TYPO3\\\\CMS\\\\Extbase\\\\Property\\\\PropertyMappingConfiguration\\:\\:setTypeConverterOption\\(\\) expects string, int given\\.$#" count: 1 - path: Classes/Controller/EventController.php + path: ../../Classes/Controller/EventController.php - message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\QueryInterface\\:\\:between\\(\\)\\.$#" count: 4 - path: Classes/Domain/Repository/EventRepository.php + path: ../../Classes/Domain/Repository/EventRepository.php - message: "#^Call to static method TYPO3\\\\CMS\\\\Core\\\\Utility\\\\MathUtility\\:\\:canBeInterpretedAsFloat\\(\\) with string will always evaluate to false\\.$#" count: 1 - path: Classes/Evaluation/LatitudeEvaluator.php + path: ../../Classes/Evaluation/LatitudeEvaluator.php - message: "#^Call to static method TYPO3\\\\CMS\\\\Core\\\\Utility\\\\MathUtility\\:\\:canBeInterpretedAsFloat\\(\\) with string will always evaluate to false\\.$#" count: 1 - path: Classes/Evaluation/LongitudeEvaluator.php + path: ../../Classes/Evaluation/LongitudeEvaluator.php - message: "#^Expression on left side of \\?\\? is not nullable\\.$#" count: 1 - path: Classes/Service/FluidStandaloneService.php + path: ../../Classes/Service/FluidStandaloneService.php - message: "#^Expression on left side of \\?\\? is not nullable\\.$#" count: 1 - path: Classes/Service/NotificationService.php + path: ../../Classes/Service/NotificationService.php - message: "#^Call to an undefined method TYPO3Fluid\\\\Fluid\\\\Core\\\\Rendering\\\\RenderingContextInterface\\:\\:getRequest\\(\\)\\.$#" count: 1 - path: Classes/ViewHelpers/PrefillViewHelper.php + path: ../../Classes/ViewHelpers/PrefillViewHelper.php - message: "#^Call to an undefined method TYPO3Fluid\\\\Fluid\\\\Core\\\\Rendering\\\\RenderingContextInterface\\:\\:getRequest\\(\\)\\.$#" count: 1 - path: Classes/ViewHelpers/Registration/Field/PrefillFieldViewHelper.php + path: ../../Classes/ViewHelpers/Registration/Field/PrefillFieldViewHelper.php - message: "#^Call to an undefined method TYPO3Fluid\\\\Fluid\\\\Core\\\\Rendering\\\\RenderingContextInterface\\:\\:getRequest\\(\\)\\.$#" count: 1 - path: Classes/ViewHelpers/Registration/Field/PrefillMultiValueFieldViewHelper.php + path: ../../Classes/ViewHelpers/Registration/Field/PrefillMultiValueFieldViewHelper.php - message: "#^Call to an undefined method TYPO3Fluid\\\\Fluid\\\\Core\\\\Rendering\\\\RenderingContextInterface\\:\\:getRequest\\(\\)\\.$#" count: 1 - path: Classes/ViewHelpers/Validation/ErrorClassViewHelper.php + path: ../../Classes/ViewHelpers/Validation/ErrorClassViewHelper.php diff --git a/phpstan.neon b/.Build/phpstan/phpstan.neon similarity index 78% rename from phpstan.neon rename to .Build/phpstan/phpstan.neon index d04816a24..56d41e6ae 100644 --- a/phpstan.neon +++ b/.Build/phpstan/phpstan.neon @@ -4,8 +4,8 @@ includes: parameters: level: 7 paths: - - Classes/ - - Configuration/ + - ../../Classes/ + - ../../Configuration/ checkMissingIterableValueType: false reportUnmatchedIgnoredErrors: true diff --git a/Tests/Build/FunctionalTests.xml b/.Build/phpunit/FunctionalTests.xml similarity index 94% rename from Tests/Build/FunctionalTests.xml rename to .Build/phpunit/FunctionalTests.xml index 3ed157bd1..56618c733 100644 --- a/Tests/Build/FunctionalTests.xml +++ b/.Build/phpunit/FunctionalTests.xml @@ -17,7 +17,7 @@ - ../Functional/ + ../../Tests/Functional/ diff --git a/Tests/Build/UnitTests.xml b/.Build/phpunit/UnitTests.xml similarity index 95% rename from Tests/Build/UnitTests.xml rename to .Build/phpunit/UnitTests.xml index 8dd10f089..bc59252df 100644 --- a/Tests/Build/UnitTests.xml +++ b/.Build/phpunit/UnitTests.xml @@ -19,7 +19,7 @@ - ../Unit/ + ../../Tests/Unit/ diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 410d80ba1..000000000 --- a/.editorconfig +++ /dev/null @@ -1,56 +0,0 @@ -# EditorConfig is awesome: http://EditorConfig.org - -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending every file -[*] -charset = utf-8 -end_of_line = lf -indent_style = space -indent_size = 4 -insert_final_newline = true -trim_trailing_whitespace = true - -# TS/JS-Files -[*.{ts,js}] -indent_size = 2 - -# JSON-Files -[*.json] -indent_style = tab - -# ReST-Files -[*.rst] -indent_size = 4 -max_line_length = 80 - -# YAML-Files -[*.{yaml,yml}] -indent_size = 2 - -# NEON-Files -[*.neon] -indent_size = 2 -indent_style = tab - -# package.json -[package.json] -indent_size = 2 - -# TypoScript -[*.{typoscript,tsconfig}] -indent_size = 2 - -# XLF-Files -[*.xlf] -indent_style = tab - -# SQL-Files -[*.sql] -indent_style = tab -indent_size = 2 - -# .htaccess -[{_.htaccess,.htaccess}] -indent_style = tab diff --git a/.github/workflows/AcceptanceTests.yml b/.github/workflows/AcceptanceTests.yml index e164b1c1c..77446cb04 100644 --- a/.github/workflows/AcceptanceTests.yml +++ b/.github/workflows/AcceptanceTests.yml @@ -39,8 +39,10 @@ jobs: run: | sudo rm -rf ~/.composer - - name: Validate composer.json and composer.lock - run: composer validate + - name: Validate composer.json + run: | + cd .Build + composer validate - name: Cache dependencies uses: actions/cache@v3 @@ -50,12 +52,14 @@ jobs: - name: Install composer dependencies run: | + cd .Build composer install --no-progress - name: Initialize TYPO3 environment run: | echo "Copy TYPO3 config to extension root path" - cp -R Tests/Acceptance/_data/config . + cp -R Tests/Acceptance/_data/config .Build/ + cd .Build echo "Run 'composer install' to activate extension" composer install --no-progress @@ -83,7 +87,7 @@ jobs: while ! nc -z 127.0.0.1 8888