-
-
Notifications
You must be signed in to change notification settings - Fork 0
Allow installing in PHP 8.2 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -22,7 +22,7 @@ jobs: | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||
| php-versions: ['8.3', '8.4', '8.5'] | ||||||||||||||||||||||||||||||||||
| php-versions: ['8.2', '8.3', '8.4', '8.5'] | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||||||||||||||||||
|
|
@@ -42,7 +42,11 @@ jobs: | |||||||||||||||||||||||||||||||||
| ini-values: pcov.directory=. | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Install dependencies | ||||||||||||||||||||||||||||||||||
| run: composer install ${{ matrix.php-versions == '8.5' && '--ignore-platform-reqs' || '' }} | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| if [ "${{ matrix.php-versions }}" == "8.2" ]; then | ||||||||||||||||||||||||||||||||||
| composer require --dev phpunit/phpunit:^11 --no-update | ||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||
| composer install ${{ matrix.php-versions == '8.5' && '--ignore-platform-reqs' || '' }} | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Validate composer.json | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
|
|
@@ -54,11 +58,17 @@ jobs: | |||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.CI_LINT_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Run tests | ||||||||||||||||||||||||||||||||||
| run: composer test-coverage | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| if [ "${{ matrix.php-versions }}" != "8.2" ]; then | ||||||||||||||||||||||||||||||||||
| composer test-coverage | ||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||
| composer test | ||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||
|
Comment on lines
60
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Clarify rationale for skipping coverage on PHP 8.2. The conditional logic skips coverage collection for PHP 8.2. Is this intentional to reduce CI time, or is there a technical limitation with PHPUnit 11 or the coverage tooling? Given that Codecov reports 100% coverage and all tests pass, this might be acceptable. However, documenting the rationale would help future maintainers understand this decision. Consider adding a comment explaining why coverage is skipped for PHP 8.2: - name: Run tests
run: |
+ # Skip coverage for PHP 8.2 to reduce CI time (coverage is collected on other PHP versions)
if [ "${{ matrix.php-versions }}" != "8.2" ]; then
composer test-coverage
else
composer test
fi
continue-on-error: ${{ vars.CI_TEST_IGNORE_FAILURE == '1' }}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
| continue-on-error: ${{ vars.CI_TEST_IGNORE_FAILURE == '1' }} | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Upload coverage report as an artifact | ||||||||||||||||||||||||||||||||||
| uses: actions/upload-artifact@v5 | ||||||||||||||||||||||||||||||||||
| if: ${{ matrix.php-versions != '8.2' }} | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| name: ${{github.job}}-code-coverage-report-${{ matrix.php-versions }} | ||||||||||||||||||||||||||||||||||
| path: .logs | ||||||||||||||||||||||||||||||||||
|
|
@@ -67,7 +77,7 @@ jobs: | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Upload test results to Codecov | ||||||||||||||||||||||||||||||||||
| uses: codecov/test-results-action@v1 | ||||||||||||||||||||||||||||||||||
| if: ${{ env.CODECOV_TOKEN != '' }} | ||||||||||||||||||||||||||||||||||
| if: ${{ env.CODECOV_TOKEN != '' && matrix.php-versions != '8.2' }} | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| files: .logs/junit.xml | ||||||||||||||||||||||||||||||||||
| fail_ci_if_error: true | ||||||||||||||||||||||||||||||||||
|
|
@@ -76,7 +86,7 @@ jobs: | |||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Upload coverage report to Codecov | ||||||||||||||||||||||||||||||||||
| uses: codecov/codecov-action@v5 | ||||||||||||||||||||||||||||||||||
| if: ${{ env.CODECOV_TOKEN != '' }} | ||||||||||||||||||||||||||||||||||
| if: ${{ env.CODECOV_TOKEN != '' && matrix.php-versions != '8.2' }} | ||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||
| files: .logs/cobertura.xml | ||||||||||||||||||||||||||||||||||
| fail_ci_if_error: true | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Add clarifying comment explaining the PHP 8.2 + PHPUnit version handling.
The conditional PHPUnit 11 requirement for PHP 8.2 is necessary because PHPUnit 12 requires PHP 8.3+, while PHPUnit 11 requires PHP 8.2+. The implementation is correct, but a comment explaining this constraint mismatch would help future maintainers understand why the workaround is needed.
Consider adding an inline comment like this:
- name: Install dependencies run: | + # PHPUnit 12 requires PHP 8.3+, so we downgrade to PHPUnit 11 for PHP 8.2 testing if [ "${{ matrix.php-versions }}" == "8.2" ]; then composer require --dev phpunit/phpunit:^11 --no-update fi composer install ${{ matrix.php-versions == '8.5' && '--ignore-platform-reqs' || '' }}This makes the version constraint rationale clear at a glance.
📝 Committable suggestion
🤖 Prompt for AI Agents