Skip to content

Commit

Permalink
chore: Added Youwe Testing Suite
Browse files Browse the repository at this point in the history
  • Loading branch information
jansentjeu committed Mar 8, 2024
1 parent 561b4be commit fff5d18
Show file tree
Hide file tree
Showing 7 changed files with 190 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/testing-suite.yaml
Original file line number Diff line number Diff line change
@@ -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
40 changes: 39 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
]
}
}
96 changes: 96 additions & 0 deletions grumphp.yml
Original file line number Diff line number Diff line change
@@ -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 <exclude-pattern>
# 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;"
- "<<<<<<<"
- ">>>>>>>"
- "======="
- "<?php echo"
git_blacklist.triggered_by: [ 'php', 'js' ]
git_blacklist.whitelist_patterns: []
git_blacklist.regexp_type: G
git_blacklist.match_word: true
git_blacklist.ignore_patterns: []

grumphp:
ascii:
failed: ~
succeeded: ~

parallel:
enabled: true

# Default tasks for testing suite
tasks:
xmllint:
load_from_net: '%xmllint.load_from_net%'
x_include: '%xmllint.x_include%'
dtd_validation: '%xmllint.dtd_validation%'
scheme_validation: '%xmllint.scheme_validation%'
triggered_by: '%xmllint.triggered_by%'
ignore_patterns: '%xmllint.ignore_patterns%'

phpcs:
standard: '%phpcs.standard%'
triggered_by: '%phpcs.triggered_by%'

phpmd:
exclude: '%phpmd.exclude%'
ruleset: '%phpmd.ruleset%'
triggered_by: '%phpmd.triggered_by%'

phpstan:
autoload_file: '%phpstan.autoload_file%'
configuration: '%phpstan.configuration%'
level: '%phpstan.level%'
triggered_by: '%phpstan.triggered_by%'
11 changes: 11 additions & 0 deletions pdepend.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<symfony:container xmlns:symfony="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://pdepend.org/schema/dic/pdepend"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<cache>
<driver>memory</driver>
</cache>
</config>
</symfony:container>
10 changes: 10 additions & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<ruleset name="PHPCS"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>PHPCS</description>
<!--<exclude-pattern>path/to/exclude/*</exclude-pattern>-->
<rule ref="YouweMagento2"/>
</ruleset>
10 changes: 10 additions & 0 deletions phpmd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<ruleset name="PHPMD"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>PHPMD</description>
<!--<exclude-pattern>path/to/exclude/*</exclude-pattern>-->
<rule ref="./vendor/youwe/coding-standard-magento2/src/YouweMagento2/phpmd.xml" />
</ruleset>
3 changes: 3 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parameters:
excludePaths:
# - %rootDir%/../../../path/to/exclude/*

0 comments on commit fff5d18

Please sign in to comment.