ci: refactor tests to use standard actions - #120
Merged
Conversation
Collaborator
Author
|
A few notes on the reason why some tests are changed (after a first failure):
So tests were changed to reflect intent:
Why this is correct:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the project’s CI to use standard GitHub Actions for PHP setup and Composer installs, enabling the test matrix to run on newer PHP versions (including 8.4 and 8.5) while keeping SVG-rendering tests deterministic across environments.
Changes:
- Refactors GitHub Actions workflows to use
shivammathur/setup-phpandramsey/composer-install, and expands the PHPUnit matrix to PHP 8.4 and 8.5. - Updates renderer tests to mock
TextSizeCalculatorInterface(instead of relying on GD/font metrics) for stable fixture comparisons. - Loosens a couple of GD text width assertions using
assertEqualsWithDeltato reduce environment-dependent flakiness.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Render/SvgSocialRenderTest.php | Replaces GD calculator usage with a mocked TextSizeCalculatorInterface returning stable widths. |
| tests/Render/SvgForTheBadgeRendererTest.php | Replaces GD calculator usage with a mocked TextSizeCalculatorInterface returning stable widths. |
| tests/Calculator/GDTextSizeCalculatorTest.php | Uses delta-based float assertions for more stable GD width checks. |
| .github/workflows/release.yml | Updates checkout action version. |
| .github/workflows/php.yml | Moves to setup-php + composer-install and expands the PHP test matrix to 8.4/8.5. |
| .github/workflows/commit-lint.yml | Updates runner version and checkout action version. |
| .gitattributes | Updates export-ignore rules (e.g., root *.md, compose.yml, doc, test/dev tooling files). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
JellyBellyDev
approved these changes
Jul 15, 2026
JellyBellyDev
left a comment
Collaborator
There was a problem hiding this comment.
Awesome!!!
LGTM 👍
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This should fix #110 (including the latest 8.5)