From 46195b0ac395103410488776f074552bd307bd83 Mon Sep 17 00:00:00 2001 From: Jacob Tobiasz Date: Thu, 5 Sep 2024 13:30:54 +0200 Subject: [PATCH] Add running QA tools in CI --- .github/workflows/ci.yaml | 12 ++++++++++++ composer-dependency-analyser.php | 14 ++++++++++++++ composer.json | 14 +++++++++++--- 3 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 composer-dependency-analyser.php diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ce15db04..90f33a13 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -57,3 +57,15 @@ jobs: symfony_version: ${{ matrix.symfony }} sylius_version: ${{ matrix.sylius }} e2e_js: true + + - name: Check dependencies + run: vendor/bin/composer-dependency-analyser + + - name: Static analysis + run: vendor/bin/phpstan + + - name: Check coding standard + run: vendor/bin/ecs check + + - name: Run tests + run: vendor/bin/phpunit diff --git a/composer-dependency-analyser.php b/composer-dependency-analyser.php new file mode 100644 index 00000000..82f21604 --- /dev/null +++ b/composer-dependency-analyser.php @@ -0,0 +1,14 @@ +addPathToScan(__DIR__ . '/src', isDev: false) + ->disableComposerAutoloadPathScan() // disable automatic scan of autoload & autoload-dev paths from composer.json + ->ignoreErrorsOnPackage('sylius/sylius', [ErrorType::DEV_DEPENDENCY_IN_PROD]) + ->ignoreErrorsOnPackage('sylius/core-bundle', [ErrorType::UNUSED_DEPENDENCY]) +; diff --git a/composer.json b/composer.json index 5c09974b..6992ef6b 100644 --- a/composer.json +++ b/composer.json @@ -5,8 +5,7 @@ "license": "MIT", "autoload": { "psr-4": { - "CommerceWeavers\\SyliusTpayPlugin\\": "src/", - "Tests\\CommerceWeavers\\SyliusTpayPlugin\\Behat\\": "tests/Behat" + "CommerceWeavers\\SyliusTpayPlugin\\": "src/" } }, "autoload-dev": { @@ -18,7 +17,15 @@ "require": { "php": "^8.0", "sylius/core-bundle": "^1.12", - "tpay-com/tpay-openapi-php": "^1.8" + "tpay-com/tpay-openapi-php": "^1.8", + "payum/core": "^1.7", + "sylius/resource-bundle": "^1.10", + "symfony/config": "5.4.* || ^6.0", + "symfony/dependency-injection": "5.4.* || ^6.0", + "symfony/form": "5.4.* || ^6.0", + "symfony/http-foundation": "5.4.* || ^6.0", + "symfony/http-kernel": "5.4.* || ^6.0", + "symfony/routing": "5.4.* || ^6.0" }, "conflict": { "sylius/sylius": "<1.12" @@ -32,6 +39,7 @@ "phpstan/phpstan-webmozart-assert": "^1.2.0", "phpunit/phpunit": "^9.5", "polishsymfonycommunity/symfony-mocker-container": "^1.0", + "shipmonk/composer-dependency-analyser": "^1.7", "sylius-labs/coding-standard": "^4.2", "sylius/sylius": "^1.12", "symfony/browser-kit": "^5.4 || ^6.0",