GH Actions: tweak the way the PHPCS versions are set #300
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.
As things were, whenever the minimum PHPCS or WPCS version would be changed, the branch protection settings for both the
main
and thedevelop
branch would need to be updated and all "required builds" referencing the old PHPCS/WPCS version would need to be removed, while new "required builds" would need to be added referencing the new minimum PHPCS/WPCS version.This was a fiddly process and time-consuming.
The change proposed in this commit takes advantage of the Composer
--prefer-lowest
setting to achieve the same without a hard-coded PHPCS/WPCS version in the build name, which means that once the branch protection settings have been updated for this PR, they shouldn't need updating anymore for future PHPCS/WPCS version bumps.Notes:
--prefer-lowest
command is not run via theramsey/composer-install
action runner, but in a separate step. Running it viaramsey/composer-install
would also impact the PHPUnit version, which would break the builds.test.yml
workflow, not in thequicktest.yml
workflow. - The builds inquicktest
are not required, so do not impact the branch protection settings. - This also allows to still test mixed high/low variants (i.e. low PHPCS, high WPCS and visa versa) via thequicktest
workflow.As a side-effect of this PR, the
test
workflow will now have only half the amount of builds as before.