Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
309 changes: 164 additions & 145 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,148 +7,167 @@ on:
- master

jobs:
php81:
name: PHP 8.1
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 2

- name: "Install PHP 8.1"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.1"

- name: "Cache composer packages"
uses: "actions/cache@v4"
with:
path: "~/.composer/cache"
key: "php-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction"

- name: "Run PHPUnit Tests"
run: "composer test"

- name: "Run PHP CS Check"
run: "composer cs-check"

- name: "Run Psalm"
run: "composer psalm"

- name: "Run infection"
run: "composer infection-ci"

php82:
name: PHP 8.2
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 2

- name: "Install PHP 8.2"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.2"

- name: "Cache composer packages"
uses: "actions/cache@v4"
with:
path: "~/.composer/cache"
key: "php-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction"

- name: "Run PHPUnit Tests"
run: "composer test"

- name: "Run PHP CS Check"
run: "composer cs-check"

- name: "Run Psalm"
run: "composer psalm"

- name: "Run infection"
run: "composer infection-ci"

php83:
name: PHP 8.3
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 2

- name: "Install PHP 8.3"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.3"

- name: "Cache composer packages"
uses: "actions/cache@v4"
with:
path: "~/.composer/cache"
key: "php-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction"

- name: "Run PHPUnit Tests"
run: "composer test"

- name: "Run PHP CS Check"
run: "composer cs-check"

- name: "Run Psalm"
run: "composer psalm"

- name: "Run infection"
env:
INFECTION_BADGE_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
run: "composer infection-ci"

php84:
name: PHP 8.4
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
fetch-depth: 2

- name: "Install PHP 8.4"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.4"

- name: "Cache composer packages"
uses: "actions/cache@v4"
with:
path: "~/.composer/cache"
key: "php-composer-locked-${{ hashFiles('composer.lock') }}"
restore-keys: "php-composer-locked-"

- name: "Install dependencies with composer"
run: "composer install --no-interaction"

- name: "Run PHPUnit Tests"
run: "composer test"

- name: "Run PHP CS Check"
run: "PHP_CS_FIXER_IGNORE_ENV=1 composer cs-check"

- name: "Run Psalm"
run: "composer psalm"

- name: "Run infection"
run: "composer infection-ci"
phpunit:
name: "PHP ${{ matrix.php }} - PHPUnit"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3', '8.4' ]
steps:
- name: "Checkout"
uses: actions/checkout@v5
with:
fetch-depth: 2

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: "Cache composer packages"
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-composer-locked-${{ hashFiles('composer.lock') }}
restore-keys: php-composer-locked-

- name: "Install dependencies"
run: composer install --no-interaction

- name: "Run PHPUnit Tests"
run: composer test

cs:
name: "PHP ${{ matrix.php }} - CS Check"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3', '8.4' ]
steps:
- name: "Checkout"
uses: actions/checkout@v5
with:
fetch-depth: 2

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: "Cache composer packages"
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-composer-locked-${{ hashFiles('composer.lock') }}
restore-keys: php-composer-locked-

- name: "Install dependencies"
run: composer install --no-interaction

- name: "Run PHP CS Check"
run: composer cs-check

phpmd:
name: "PHP ${{ matrix.php }} - PHP Mess Detector"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3', '8.4' ]
steps:
- name: "Checkout"
uses: actions/checkout@v5
with:
fetch-depth: 2

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: "Cache composer packages"
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-composer-locked-${{ hashFiles('composer.lock') }}
restore-keys: php-composer-locked-

- name: "Install dependencies"
run: composer install --no-interaction

- name: "Run PHP Mess Detector"
run: composer phpmd

psalm:
name: "PHP ${{ matrix.php }} - Psalm"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3', '8.4' ]
steps:
- name: "Checkout"
uses: actions/checkout@v5
with:
fetch-depth: 2

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: "Cache composer packages"
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-composer-locked-${{ hashFiles('composer.lock') }}
restore-keys: php-composer-locked-

- name: "Install dependencies"
run: composer install --no-interaction

- name: "Run Psalm"
run: composer psalm

infection:
name: "PHP ${{ matrix.php }} - Infection"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: [ '8.1', '8.2', '8.3', '8.4' ]
steps:
- name: "Checkout"
uses: actions/checkout@v5
with:
fetch-depth: 2

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}

- name: "Cache composer packages"
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: php-composer-locked-${{ hashFiles('composer.lock') }}
restore-keys: php-composer-locked-

- name: "Install dependencies"
run: composer install --no-interaction

- name: "Generate PHPUnit coverage for Infection"
run: composer test

- name: "Run infection (with badge upload)"
if: matrix.php == '8.3'
env:
INFECTION_BADGE_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
run: composer infection-ci

- name: "Run infection"
if: matrix.php != '8.3'
run: composer infection-ci
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
This Changelog refers to all changes since v5.0.0
***

# v6.0.0
+ Upgrade of dependencies, removed PHP 8.0 support.
+ Modernize code
+ Adding PHP mess detector
+ Restructure GitHub workflow actions.

# v5.0.1
+ Upgrade of dependencies, removal of PHPStan as I focused more on Psalm.
+ All test classes are now final and use attributes instead of annotations.
Expand Down
6 changes: 6 additions & 0 deletions UPGRADE-6.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# UPGRADE FROM 5.x to 6.0

### Breaking Changes:

+ Support for PHP 8.0 removed. Only PHP 8.1, 8.2, 8.3, and 8.4 are supported.
+ This library now uses named arguments.
15 changes: 7 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"ext-bcmath": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.68",
"infection/infection": "0.27.10|^0.29.10",
"friendsofphp/php-cs-fixer": "^3.87",
"infection/infection": "^0.27|^0.29.14",
"phpstan/extension-installer": "*",
"phpunit/phpunit": "^10.5 | ^11.5",
"phpunit/phpunit": "^10.5|^12.3",
"psalm/plugin-phpunit": "^0.19",
"squizlabs/php_codesniffer": "^3.11",
"vimeo/psalm": "^5.0|^6.0"
"phpmd/phpmd": "^2.15",
"vimeo/psalm": "^5.26|^6.0"
},
"autoload": {
"psr-4": {
Expand All @@ -39,18 +39,17 @@
},
"prefer-stable": true,
"scripts": {
"phpcs": "phpcs --standard=phpcs.xml.dist",
"cs-check": "php-cs-fixer -v --dry-run --using-cache=no fix",
"cs-fix": "php-cs-fixer --using-cache=no fix",
"phpmd": "vendor/bin/phpmd src,tests text phpmd.xml.dist",
"test": "export XDEBUG_MODE=coverage && phpunit -c phpunit.xml --coverage-xml build/logs --coverage-clover build/logs/clover.xml --coverage-html build/logs/clover.html --log-junit build/logs/junit.xml",
"psalm": "vendor/bin/psalm --no-cache",
"infection": "infection --threads=4",
"infection-ci": "infection --coverage=build/logs --threads=4",
"check": [
"@phpcs",
"@cs-check",
"@phpmd",
"@psalm",
"@analyze",
"@test"
]
}
Expand Down
Loading