diff --git a/.github/workflows/testing-suite.yaml b/.github/workflows/testing-suite.yaml new file mode 100644 index 0000000..c8f747f --- /dev/null +++ b/.github/workflows/testing-suite.yaml @@ -0,0 +1,21 @@ +name: Testing Suite +on: [push] +jobs: + PHP: + strategy: + matrix: + image: [ + 'srcoder/development-php:php82-fpm' + ] + runs-on: ubuntu-latest + container: + image: ${{ matrix.image }} + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Testing Suite + run: | + composer2 install --dev --prefer-dist --no-scripts --no-progress --optimize-autoloader --no-interaction -vvv + composer2 show + composer2 exec -v grumphp run + shell: bash diff --git a/composer.json b/composer.json index ad2d4d9..b9685a5 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,13 @@ "php": ">=8.0 <8.3" }, "require-dev": { - "fzaninotto/faker": "^1.7" + "bitexpert/phpstan-magento": "^0.30.1", + "fzaninotto/faker": "^1.7", + "magento/framework": "^103.0", + "phpstan/extension-installer": "^1.3", + "symfony/finder": "^6.4.0", + "youwe/coding-standard-magento2": "^2.0.0", + "youwe/testing-suite": "^2.17" }, "replace": { "emico/tweakwise-export": "v4.2.4" @@ -21,5 +27,37 @@ "psr-4": { "Tweakwise\\Magento2TweakwiseExport\\": "" } + }, + "repositories": [ + { + "type": "composer", + "url": "https://repo.magento.com/" + } + ], + "config": { + "sort-packages": true, + "allow-plugins": { + "magento/composer-dependency-version-audit-plugin": true, + "youwe/coding-standard-phpstorm": true, + "phpro/grumphp-shim": true, + "dealerdirect/phpcodesniffer-composer-installer": true, + "youwe/testing-suite": true, + "phpstan/extension-installer": true + } + }, + "archive": { + "exclude": [ + "/.gitignore", + "/tests", + "/grumphp.yml", + "/pdepend.xml", + "/phpstan.neon", + "/phpunit.xml", + "/phpcs.xml", + "/phpmd.xml", + "/package.json", + "/.eslintrc.json", + "/.eslintignore" + ] } } diff --git a/grumphp.yml b/grumphp.yml new file mode 100644 index 0000000..71f55d0 --- /dev/null +++ b/grumphp.yml @@ -0,0 +1,96 @@ +parameters: + # Default settings for php testing suite tasks + composer.strict: true + + jsonlint.detect_key_conflicts: true + + xmllint.load_from_net: true + xmllint.x_include: true + xmllint.dtd_validation: true + xmllint.scheme_validation: true + xmllint.triggered_by: [xml] + xmllint.ignore_patterns: + # Uses an incomplete definition, which conflicts when + # is defined. + - /^phpcs.xml$/ + - /^phpmd.xml$/ + - /^phpunit.xml$/ + - /^pdepend.xml$/ + + yamllint.parse_constant: true + + phpcs.standard: ./phpcs.xml + phpcs.triggered_by: [php,phtml] + + phplint.exclude: ['vendor'] + phplint.jobs: ~ + phplint.short_open_tag: false + phplint.ignore_patterns: [ ] + phplint.triggered_by: ['php'] + + phpmd.exclude: [] + phpmd.ruleset: + - ./phpmd.xml + phpmd.triggered_by: [php] + + phpstan.autoload_file: ~ + phpstan.configuration: ./phpstan.neon + phpstan.level: 4 + phpstan.triggered_by: [php] + + phpunit.config_file: ./phpunit.xml + + securitychecker.lockfile: ./composer.lock + securitychecker.run_always: true + + git_blacklist.keywords: + - "die(" + - "dd(" + - "var_dump(" + - "console.log(" + - "print_r(" + - "phpinfo(" + - "exit(" + - "exit;" + - "<<<<<<<" + - ">>>>>>>" + - "=======" + - " + + + + memory + + + diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..2dfb6fd --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,10 @@ + + + PHPCS + + + diff --git a/phpmd.xml b/phpmd.xml new file mode 100644 index 0000000..1b454e9 --- /dev/null +++ b/phpmd.xml @@ -0,0 +1,10 @@ + + + PHPMD + + + diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..9314954 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,3 @@ +parameters: + excludePaths: +# - %rootDir%/../../../path/to/exclude/*