From 61b2665a6898b52f98cc4c045bb103db1f86dab2 Mon Sep 17 00:00:00 2001 From: Dominic Watts Date: Mon, 23 Aug 2021 21:00:24 +0100 Subject: [PATCH] git hub actions --- .github/workflows/phpcompatibility.yml | 9 +++++++++ .github/workflows/phpcs.yml | 9 +++++++++ .github/workflows/phpcsfixer.yml | 9 +++++++++ .github/workflows/phpstan.yml | 15 +++++++++++++++ .github/workflows/phpunit.yml | 15 +++++++++++++++ .github/workflows/xmllint.yml | 21 +++++++++++++++++++++ phpstan.neon | 23 +++++++---------------- 7 files changed, 85 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/phpcompatibility.yml create mode 100644 .github/workflows/phpcs.yml create mode 100644 .github/workflows/phpcsfixer.yml create mode 100644 .github/workflows/phpstan.yml create mode 100644 .github/workflows/phpunit.yml create mode 100644 .github/workflows/xmllint.yml diff --git a/.github/workflows/phpcompatibility.yml b/.github/workflows/phpcompatibility.yml new file mode 100644 index 0000000..655d94c --- /dev/null +++ b/.github/workflows/phpcompatibility.yml @@ -0,0 +1,9 @@ +name: PHPCompatibility +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: 7.0-7.1 + run: docker run --rm -v $PWD:/code domw/phpcompatibility phpcs --standard=PHPCompatibility --runtime-set testVersion 7.0-7.1 --colors --ignore=./Test/ ./ diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml new file mode 100644 index 0000000..9787dcd --- /dev/null +++ b/.github/workflows/phpcs.yml @@ -0,0 +1,9 @@ +name: phpcs +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Magento 2 Ruleset + run: docker run --rm -v $PWD:/code domw/phpcs phpcs --colors --standard=Magento2 ./ diff --git a/.github/workflows/phpcsfixer.yml b/.github/workflows/phpcsfixer.yml new file mode 100644 index 0000000..a228d9d --- /dev/null +++ b/.github/workflows/phpcsfixer.yml @@ -0,0 +1,9 @@ +name: php-cs-fixer +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: PHP CS Fixer + run: docker run --rm -v $PWD:/code domw/php-cs-fixer php-cs-fixer fix --dry-run --diff --stop-on-violation --allow-risky=yes ./ diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml new file mode 100644 index 0000000..784dece --- /dev/null +++ b/.github/workflows/phpstan.yml @@ -0,0 +1,15 @@ +name: PHPStan +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: MilesChou/composer-action@master + with: + args: config http-basic.repo.magento.com 7bdd660a63609d2af9fcbc033a9eae8d 77c0cedb4871620c63acbd82aeb92f38 + - uses: MilesChou/composer-action@master + with: + args: install --prefer-dist --ignore-platform-reqs + - name: PHPStan + run: docker run --rm -v $PWD:/code domw/phpstan phpstan analyze ./ \ No newline at end of file diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml new file mode 100644 index 0000000..d771277 --- /dev/null +++ b/.github/workflows/phpunit.yml @@ -0,0 +1,15 @@ +name: PHPUnit +on: ["push", "pull_request"] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: MilesChou/composer-action@master + with: + args: config http-basic.repo.magento.com 7bdd660a63609d2af9fcbc033a9eae8d 77c0cedb4871620c63acbd82aeb92f38 + - uses: MilesChou/composer-action@master + with: + args: install --prefer-dist --ignore-platform-reqs + - name: PHPUnit + run: vendor/bin/phpunit -c Test/phpunit.xml Test/ diff --git a/.github/workflows/xmllint.yml b/.github/workflows/xmllint.yml new file mode 100644 index 0000000..51af8e4 --- /dev/null +++ b/.github/workflows/xmllint.yml @@ -0,0 +1,21 @@ +name: xmllint +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: MilesChou/composer-action@master + with: + args: config http-basic.repo.magento.com 7bdd660a63609d2af9fcbc033a9eae8d 77c0cedb4871620c63acbd82aeb92f38 + - uses: MilesChou/composer-action@master + with: + args: install --prefer-dist --ignore-platform-reqs + - name: XML Lint + run: | + docker run --rm -v $PWD:/code domw/xmllint --noout ./etc/adminhtml/menu.xml --schema ./vendor/magento/module-backend/etc/menu.xsd + docker run --rm -v $PWD:/code domw/xmllint --noout ./etc/adminhtml/routes.xml --schema ./vendor/magento/framework/App/etc/routes.xsd + docker run --rm -v $PWD:/code domw/xmllint --noout ./etc/acl.xml --schema ./vendor/magento/framework/Acl/etc/acl.xsd + docker run --rm -v $PWD:/code domw/xmllint --noout ./etc/cron_groups.xml --schema ./vendor/magento/module-cron/etc/cron_groups.xsd + docker run --rm -v $PWD:/code domw/xmllint --noout ./etc/crontab.xml --schema ./vendor/magento/module-cron/etc/crontab.xsd + docker run --rm -v $PWD:/code domw/xmllint --noout ./etc/module.xml --schema ./vendor/magento/framework/Module/etc/module.xsd diff --git a/phpstan.neon b/phpstan.neon index d2755cc..75e69ef 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,20 +1,11 @@ parameters: level: max - inferPrivatePropertyTypeFromConstructor: true - paths: - - . - bootstrapFiles: - - vendor/bitexpert/phpstan-magento/autoload.php excludes_analyse: - - %currentWorkingDirectory%/vendor/* + - 'vendor' ignoreErrors: - - '/ has no return typehint specified./' - - - message: '/Use service contracts to persist entities in favour of Magento\\Cron\\Model\\Schedule\:\:save\(\) method/' - path: Cron/ScheduleJob.php - - - message: '/Call to deprecated method save\(\) of class Magento\\Framework\\Model\\AbstractModel/' - path: Cron/ScheduleJob.php - - - message: '/Parameter \#1 \$autoload_function of function spl_autoload_register expects callable\(string\)\: void, array\(Magento\\Framework\\TestFramework\\Unit\\Autoloader\\GeneratedClassesAutoloader/' - path: Test/bootstrap.php + - '#typehint#' + - '#Factory#' + - '#Use service contracts to persist entities#' + - '#Call to deprecated method save#' + - '#Parameter \#1 \$autoload_function of function spl_autoload_register#' + reportUnmatchedIgnoredErrors: false \ No newline at end of file