diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c7c100..650fffe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ name: Tests -on: [push, pull_request] +on: [pull_request] jobs: @@ -9,7 +9,7 @@ jobs: strategy: max-parallel: 10 matrix: - php: ['7.3', '7.4', '8.0'] + php: ['7.3', '7.4', '8.0', '8.1', '8.2'] steps: - name: Set up PHP diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index ea31e01..f256d50 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -1,37 +1,67 @@ -on: [push, pull_request] +on: [ pull_request ] name: Static analysis jobs: phpstan: name: PHPStan - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 + steps: - name: Checkout code uses: actions/checkout@v2 - - name: PHPStan - uses: docker://oskarstark/phpstan-ga - env: - REQUIRE_DEV: true + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: - args: analyze --no-progress + php-version: 8.1 + extensions: apcu, redis + coverage: none + tools: phpstan:1.6.8, cs2pr - php-cs-fixer: - name: PHP-CS-Fixer - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: PHP-CS-Fixer - uses: docker://oskarstark/php-cs-fixer-ga - with: - args: --dry-run --diff-format udiff + - name: Download dependencies + uses: ramsey/composer-install@v1 + + - name: PHPStan + run: phpstan analyze --no-progress --error-format=checkstyle | cs2pr psalm: name: Psalm - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout code uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + extensions: apcu, redis + coverage: none + tools: vimeo/psalm:4.22.0 + + - name: Download dependencies + uses: ramsey/composer-install@v1 + - name: Psalm - uses: docker://vimeo/psalm-github-actions \ No newline at end of file + run: psalm --no-progress --output-format=github + + php-cs-fixer: + name: PHP-CS-Fixer + runs-on: ubuntu-20.04 + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.1 + coverage: none + tools: php-cs-fixer:3.13, cs2pr + + - name: Display PHP-CS-Fixer version + run: php-cs-fixer --version + + - name: PHP-CS-Fixer + run: php-cs-fixer fix --dry-run --format=checkstyle | cs2pr diff --git a/.gitignore b/.gitignore index a398fd9..d7d3a9c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/.php_cs.cache +/.php-cs-fixer.cache /.phpunit.result.cache /composer.lock /phpunit.xml diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..90d5d60 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,13 @@ +in(__DIR__.'/src') + ->in(__DIR__.'/tests') +; + +return (new PhpCsFixer\Config()) + ->setRules([ + '@Symfony' => true, + ]) + ->setFinder($finder) +; diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 1ca9819..0000000 --- a/.php_cs +++ /dev/null @@ -1,14 +0,0 @@ -in(__DIR__) - ->exclude(__DIR__.'/vendor') -; - -return PhpCsFixer\Config::create() - ->setRules([ - '@Symfony' => true, - 'array_syntax' => ['syntax' => 'short'], - ]) - ->setFinder($finder) -; \ No newline at end of file diff --git a/composer.json b/composer.json index 875626f..5af89d9 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "symfony/messenger": "^4.4 || ^5.0 || ^6.0" }, "require-dev": { - "phpunit/phpunit": "^8.4", + "phpunit/phpunit": "^8.5.31", "symfony/validator": "^5.0 || ^6.0", "symfony/polyfill-php80": "^1.17", "symfony/event-dispatcher-contracts": "^2.0"