Skip to content

Commit

Permalink
[Stan]: Fix matrix to test Pimcore 6.9 (#54)
Browse files Browse the repository at this point in the history
* Update static-analysis.yaml

* add allow plugin fix

* Update static-analysis.yaml

* Create phpstan-lowest.neon

* bump phpstan to 1.10

* avoid symfony 3

* Update static-analysis.yaml
  • Loading branch information
kingjia90 authored May 26, 2023
1 parent 089df59 commit b919d35
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
strategy:
matrix:
include:
- { php-version: "7.2", dependencies: "lowest", pimcore_version: "", phpstan_args: "", experimental: false }
- { php-version: "8.0", dependencies: "highest", pimcore_version: "", phpstan_args: "", experimental: false }
- { php-version: "8.1", dependencies: "highest", pimcore_version: "", phpstan_args: "", experimental: false }
- { php-version: "8.1", dependencies: "highest", pimcore_version: "11.x-dev", phpstan_args: "", experimental: true }
steps:
- name: "Checkout code"
uses: "actions/checkout@v2"
Expand All @@ -40,12 +40,22 @@ jobs:
PIMCORE_VERSION: "${{ matrix.pimcore_version }}"
run: |
if [ ! -z "$PIMCORE_VERSION" ]; then
composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION} as 10.99.9"
composer require --no-update pimcore/pimcore:"${PIMCORE_VERSION}"
fi
- name: "Fix composer plugins (remove when removing Pimcore 6.9 support)"
run: |
composer config --no-plugins allow-plugins.endroid/installer true
composer config --no-plugins allow-plugins.ocramius/package-versions true
- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v2"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run a static analysis with phpstan/phpstan"
run: "vendor/bin/phpstan analyse ${{ matrix.phpstan_args }} -c phpstan.neon --memory-limit=-1"
- name: "Run a static analysis with phpstan/phpstan (highest)"
if: ${{ matrix.dependencies == 'highest' }}
run: "vendor/bin/phpstan analyse --memory-limit=-1"

- name: "Run a static analysis with phpstan/phpstan (lowest)"
if: ${{ matrix.dependencies == 'lowest' }}
run: "vendor/bin/phpstan analyse --memory-limit=-1 -c phpstan-lowest.neon"
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
"require": {
"pimcore/pimcore": "^6.8 || ^10.0"
},
"conflict": {
"symfony/symfony": "<4.1"
},
"require-dev": {
"phpstan/phpstan": "^1.2"
"phpstan/phpstan": "^1.10"
},
"extra": {
"pimcore": {
Expand Down
9 changes: 9 additions & 0 deletions phpstan-lowest.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
includes:
- phpstan.neon

parameters:
ignoreErrors:
-
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) invoked with 2 parameters, 1 required\\.$#"
count: 1
path: src/Service.php

0 comments on commit b919d35

Please sign in to comment.