Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ updates:
- "/tools/infection"
- "/tools/phpbench"
- "/tools/phpstan"
- "/tools/psalm"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ jobs:
- "8.2"
- "8.3"
- "8.4"
- "8.5"
operating-system:
- "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
uses: "actions/checkout@v6"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
Expand Down Expand Up @@ -72,12 +73,12 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
uses: "actions/checkout@v6"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
coverage: none
Comment thread
norberttech marked this conversation as resolved.
php-version: "8.1"
ini-values: memory_limit=-1
tools: composer:v2
Expand Down Expand Up @@ -107,14 +108,14 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@v4"
uses: "actions/checkout@v6"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
tools: composer:v2
php-version: "8.1"
php-version: "8.2"
ini-values: memory_limit=-1

- name: "Get Composer Cache Directory"
Expand All @@ -127,9 +128,9 @@ jobs:
with:
path: |
${{ steps.composer-cache.outputs.dir }}
key: "php-8.1-locked-composer-${{ hashFiles('**/composer.lock') }}"
key: "php-8.2-locked-composer-${{ hashFiles('**/composer.lock') }}"
restore-keys: |
php-8.1-locked-composer-
php-8.2-locked-composer-

- name: "Install locked dependencies"
run: "composer install --no-interaction --no-progress --no-suggest"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ var/
.DS_Store
.idea
.phpunit.cache/
composer.lock
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this one, why does it need to be removed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without a composer.lock it is easier to test a widen range dependency like "symfony/expression-language": "^5.4|^6.4|^7.3|^8.0".
With a composer.lock this dependency would be lock to a version that is compatible with the lowest supported PHP version. But since composer.lock is committed, the platform config override needs to be set. This override prevents running test with latest Symfony 8.0 since it is locked on PHP 8.1.

I will overhaul the CI to support runs with all supported Symfony Versions on specific PHP Versions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, now it makes sense. So in general I like this approach, especially that php-matcher doesn't really have other big dependencies.

How would you approach this problem if for example there would be another library that we would like to support multiple versions.
Another lib with just 2 versions to test against, like 2 & 3 would pretty much double the amount of tests we need to run. Wouldn't that make the test matrix insanely big?

23 changes: 7 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": "~8.1 || ~8.2 || ~8.3 || ~8.4",
"php": "~8.1 || ~8.2 || ~8.3 || ~8.4 || ~8.5",
Comment thread
norberttech marked this conversation as resolved.
Outdated
"ext-filter": "*",
"ext-json": "*",
"ext-simplexml": "*",
Expand All @@ -24,12 +24,9 @@
"doctrine/lexer": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^10.4",
"phpunit/phpunit": "^10.5",
"openlss/lib-array2xml": "^1.0",
"symfony/expression-language": "^5.4|^6.4|^7.0",
"symfony/cache": "^5.4|^6.4",
"nikic/php-parser": "^4.0",
"symfony/var-exporter": "^5.4|^6.4|^7.0"
Comment on lines -29 to -32
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed those dependencies as they are not used (directly)

"symfony/expression-language": "^5.4|^6.4|^7.3|^8.0"
},
"suggest": {
"openlss/lib-array2xml": "In order ot use Coduo\\PHPMatcher\\Matcher\\XmlMatcher",
Expand All @@ -47,10 +44,7 @@
}
},
"config": {
"sort-packages": true,
"platform": {
"php": "8.1"
}
"sort-packages": true
},
"scripts": {
"benchmark": [
Expand All @@ -70,26 +64,23 @@
],
"test:mutation": [
"Composer\\Config::disableProcessTimeout",
"tools\/infection\/vendor\/bin\/infection -j2"
"tools\/infection\/vendor\/bin\/infection --threads=4"
Comment thread
norberttech marked this conversation as resolved.
],
"static:analyze": [
"tools\/cs-fixer\/vendor\/bin\/php-cs-fixer fix --dry-run",
"tools\/psalm\/vendor\/bin\/psalm --shepherd --stats",
"tools\/phpstan\/vendor\/bin\/phpstan analyze -c phpstan.neon"
],
"tools:install": [
"composer install --working-dir=./tools/cs-fixer",
"composer install --working-dir=./tools/infection",
"composer install --working-dir=./tools/phpbench",
"composer install --working-dir=./tools/phpstan",
"composer install --working-dir=./tools/psalm --ignore-platform-req=php"
"composer install --working-dir=./tools/phpstan"
],
"tools:update": [
"composer update --working-dir=./tools/cs-fixer",
"composer update --working-dir=./tools/infection",
"composer update --working-dir=./tools/phpbench",
"composer update --working-dir=./tools/phpstan",
"composer update --working-dir=./tools/psalm --ignore-platform-req=php"
"composer update --working-dir=./tools/phpstan"
],
"post-install-cmd": [
"@tools:install"
Expand Down
Loading
Loading