-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Run PHPUnit jobs across multiple PHP versions #46510
Merged
Merged
Changes from all commits
Commits
Show all changes
79 commits
Select commit
Hold shift + click to select a range
b555d9d
Add a small change to create a PR.
anton-vlasenko 6547f78
Add multiple php versions.
anton-vlasenko 4bf84bb
Add multiple php versions.
anton-vlasenko 1285d42
Define phpVersion as environment variable.
anton-vlasenko cd74382
Add phpunit tags for PHP 8.1 and 8.2.
anton-vlasenko 20e6d53
Remove hyphen.
anton-vlasenko f192e2e
Nove PHPUnit tests to a separate file.
anton-vlasenko 0da70ae
Disable `fail-fast`.
anton-vlasenko c3bbb6a
Update matrix.os.
anton-vlasenko 9b6cd40
Install composer dependencies.
anton-vlasenko 53180a4
Revert "Install composer dependencies."
anton-vlasenko b60db3d
Revert "Revert "Install composer dependencies.""
anton-vlasenko 2a687ae
Fixing "no phpunit found" error.
aaroncampbell c161a74
Revert "Fixing "no phpunit found" error."
anton-vlasenko 4381998
Add phpunit tags for PHP 8.1 and 8.2.
anton-vlasenko f340a41
Debug the phpunitImage.
anton-vlasenko aa50d13
Use correct composer version.
anton-vlasenko c67c5b6
Fix container name.
anton-vlasenko 9575fc7
Don't modify package.json.
anton-vlasenko 4d6bdd4
Don't install composer dependencies twice.
anton-vlasenko 461200f
Need to prefix commands with npm run.
anton-vlasenko b299003
Add double dashes to pass flags to wp-env.
anton-vlasenko d722186
Fix name of the environment.
anton-vlasenko 8c774d0
Add additional debug information.
anton-vlasenko 4319bac
Composer dependencies should be installed after wp-env is intialised.
anton-vlasenko b245bc6
Fix wrong command.
anton-vlasenko 6057268
Since the tests are currently run within the Docker containers where …
anton-vlasenko f8173c6
Fix path to the multisite.xml.
anton-vlasenko 0b8dff9
Fix the test class to be compatible with PHP < 7.3.
anton-vlasenko 2fbdcc4
Fix bug in WP_REST_Block_Pattern_Categories_Controller_Test::wpTearDo…
anton-vlasenko 76fcd32
Remove incompatible PHP packages.
anton-vlasenko 82745d8
Remove incompatible PHP packages.
anton-vlasenko db2044e
Update description.
anton-vlasenko 460da7c
Remove incompatible PHP packages.
anton-vlasenko 1f607b5
Remove incompatible PHP packages.
anton-vlasenko d90b2fc
Fix wrong matrix value.
anton-vlasenko 61a096f
Remove incompatible PHP packages.
anton-vlasenko 8232cd1
Don't remove polyfills.
anton-vlasenko 5dfa520
Don't remove spathie package on PHP 7.2.
anton-vlasenko bc9af74
// strpos() doesn't support negative offset values on PHP prior to ve…
anton-vlasenko 185f26a
Add cliPhpVersion config parameter.
anton-vlasenko 118286f
Don't use custom commands to run the tests.
anton-vlasenko 7abd2c3
Revert "Add cliPhpVersion config parameter."
anton-vlasenko a6d2aee
Don't use the phpunit docker-compose service.
anton-vlasenko 5890fb6
Fix dynamic properties. PHP 8.2 doesn't support dynamic properties.
anton-vlasenko be706c6
Fix dynamic properties. PHP 8.2 doesn't support dynamic properties.
anton-vlasenko d44e9fa
Fix dynamic properties. PHP 8.2 doesn't support dynamic properties.
anton-vlasenko 780e12e
Allow /.cache/.gitkeep files.
anton-vlasenko 1cbe0ee
Add the .gitkeep file.
anton-vlasenko f1cb171
Add PHP Coding Stadnards.
anton-vlasenko 2d5e7f0
Fix the if condition.
anton-vlasenko 1636e2d
Fix path.
anton-vlasenko f9dfc91
Rename Core to Gutenberg.
anton-vlasenko 10e5d0f
Add job's description.
anton-vlasenko 31d5f22
Add a comment to explain why we need the /.cache folder.
anton-vlasenko 5c92300
Add a comment to explain why we need complicated .gitignore rules.
anton-vlasenko c16e8e5
Fix grammar.
anton-vlasenko 9ac9073
Revert accidental changes.
anton-vlasenko 1b0d068
Revert accidental changes.
anton-vlasenko bb0f4b7
Allow manually triggering the workflows.
anton-vlasenko 3c90728
Remove description.
anton-vlasenko 220bf63
Let's not limit the job by path.
anton-vlasenko 6f158a7
PHP 7.3 and 7.4 should use PHPUnit 9.
anton-vlasenko 76a5d0e
Update the changelog.
anton-vlasenko c1bf302
1. Fix yaml synthax.
anton-vlasenko 9c91766
In most repos, the convention is to have the if: above the run:.
anton-vlasenko 571f5ee
Don't log the PHP version; this information is available in the "Set …
anton-vlasenko a4c17e4
Don't log the Composer version; this information is available in the …
anton-vlasenko 8b7348b
1. Don't scan the unit tests twice.
anton-vlasenko c46a898
Fix the cs2pr report location.
anton-vlasenko 2be51c6
Update the .gitignore rule description.
anton-vlasenko ac99768
Enable fast failing to save Github resources as proposed here: https:…
anton-vlasenko 22bffeb
As the separate PHPCS run for the tests has been removed, this step s…
anton-vlasenko 7cfdaae
Use the development php.ini file (to make any errors more obvious).
anton-vlasenko 8546c9c
Use the development php.ini file (to make any errors more obvious).
anton-vlasenko 9d0a477
Revert "Use the development php.ini file (to make any errors more obv…
anton-vlasenko 2a371d8
Move the unit tests to unit-test.yml.
anton-vlasenko 8eb3280
Change the description.
anton-vlasenko 017ce16
Rename the job.
anton-vlasenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
This ignores all
.cache/.gitkeep
files but/.cache/.gitkeep
.The
/.cache/
folder is needed for thePHP Coding Standards
CI job.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.
This deserves an explanatory comment inline as it's going to be really hard to find this PR comment when someone is trying to understand why the
.cache
directory is so zig-zagged here. Can we add the explanation, and include why a simpler formulation of the rules cannot provide what we need?Is it not possible to have
PHP Coding Standards
use another directory? What is the reason for its use of.cache
here anyway?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.
I also now see that we're telling
git
to keep the.cache
directory, which seems surprising to me. why do we need to do this?if this weren't
.gitkeep
'd then this surprising change to.gitignore
presumably would also not be necessaryThere 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.
The reason for zig-zagging is the following:
I agree. Fixed in 89a4d738e13c7d6ff51d54cfa2477eb0c713c67b
Currently, Gutenberg ignores all
.cache
folders (regardless of their location).For compatibility reasons, these folders should still be ignored, while allowing the /.cache folder (in the root).
I haven't been able to come up with a simpler pattern that would allow that.
Git doesn't allow to commit empty folders. If it did, I would commit an empty folder.
Yes, it's possible, but I don't understand what's wrong with
/.cache
.A similar Core job uses a folder with the same name -
.cache
.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.
sure but why do we need or want to commit an empty directory?
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.
Because PHPCS expects the directory to which to write the cache file to exist. It will not create it.
So if the ruleset dictates that the cache file should be written to the
.cache
directory, that directory must exist as otherwise PHPCS will error out.You could, of course, choose to just let the cache file be written to the system temp directory or to the project root...
Note: the PHPCS cache file itself should definitely be
gitignored
.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.
my suspicion was that it was something like this, but if that's the case, that doesn't explain why it needs to be in
git
, it merely notes that the directory needs to be present when running the linter.if the entire purpose of coercing
git
to include an empty directory in the repo is so that a linter can run in CI then it would be simpler to create the directory when running the CI script withmkdir -p .cache
or the equivalent.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.
Well, that depends. If the ruleset contains the
cache
directive, local CS runs will also expect the directory.If the caching is only used in CI, I agree, a
mkdir
would suffice, but then again, why would the caching be limited to CI ?Also note - in most projects which use a
.cache
directory for the PHPCS cache placement, it is generally because they want to cache those files in CI and Travis (yes, that's the completely outdated reason), didn't allow for caching individual files, only allowed for caching directories, which is why people resorted to having a.cache
directory for this.GH Actions, however, does allow for caching individual files, so I honestly don't know why that
.cache
directory is still used, especially for projects setting this up from scratch. (I can understand people not having revisited their previous reason for setting it up when converting from Travis to GHA, but that's not the case here)