Skip to content
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

GH Actions: various changes #2215

Merged
merged 4 commits into from
Mar 27, 2023
Merged

GH Actions: various changes #2215

merged 4 commits into from
Mar 27, 2023

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Mar 24, 2023

This is a prelim PR before updating the PHPCS version to allow for simplifying the management of the protected branches

Note:
The protected branch settings will need an update before this PR becomes mergable, but after this, it shouldn't need updating that often anymore.
Once this PR has received approvals, I will update the required statuses and merge the PR myself.

GH Actions: minor tweak to composer install

Since Composer 2.2, we can be more specific about which platform requirements should be ignored.

This change ensures that only the "high" end of a PHP requirement will be ignored and no other platform requirements are ignored.

Ref: https://blog.packagist.com/composer-2-2/#-ignore-platform-req-improvements

GH Actions/quicktest: simplify the matrix

The include section was set up in Travis (and transferred to GH Actions) as the lowest supported PHPCS version at that time, wasn't compatible with the highest supported PHP version (yet).

As that is no longer the case, we can now bring this back to a simplified matrix for the Quick Test and just test against high/low PHP with high/low PHPCS.

GH Actions/ruleset-test: minimize the install

Given that:

  • The ruleset test doesn't need PHPUnit to run.
  • The ruleset test is run on PHP latest, which conflicts with our highest supported PHPUnit version.
  • And the Composer install is run without --ignore-platform-* resulting in PHPUnit 5.2.7 being installed (last PHPUnit version which didn't have a PHP requirement)

I propose to install with --no-dev for the ruleset test.

While this doesn't necessarily remove the "conflict", it should still make the Composer install faster and at least won't create a cache with a completely incorrect PHPUnit version.

GH Actions: tweak the way the PHPCS versions are set

As things were, whenever the minimum PHPCS version would be changed, the branch protection settings for both the master and the develop branch would need to be updated and all "required builds" referencing the old PHPCS version would need to be removed, while new "required builds" would need to be added referencing the new minimum PHPCS 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 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 version bumps.

Since Composer 2.2, we can be more specific about which platform requirements should be ignored.

This change ensures that only the "high" end of a PHP requirement will be ignored and no other platform requirements are ignored.

Ref: https://blog.packagist.com/composer-2-2/#-ignore-platform-req-improvements
The `include` section was set up in Travis (and transferred to GH Actions) as the _lowest_ supported PHPCS version at that time, wasn't compatible with the highest supported PHP version (yet).

As that is no longer the case, we can now bring this back to a simplified matrix for the Quick Test and just test against high/low PHP with high/low PHPCS.
Given that:
* The ruleset test doesn't need PHPUnit to run.
* The ruleset test is run on PHP `latest`, which conflicts with our highest supported PHPUnit version.
* And the Composer install is run without `--ignore-platform-*` resulting in PHPUnit 5.2.7 being installed (last PHPUnit version which didn't have a PHP requirement)

I propose to install with `--no-dev` for the ruleset test.

While this doesn't necessarily remove the "conflict", it should still make the Composer install faster and at least won't create a cache with a completely incorrect PHPUnit version.
@jrfnl jrfnl added this to the 3.0.0 milestone Mar 24, 2023
@jrfnl jrfnl force-pushed the feature/ghactions-test-changes branch 2 times, most recently from 2e1f3a2 to df2ac17 Compare March 24, 2023 11:16
As things were, whenever the minimum PHPCS version would be changed, the branch protection settings for both the `master` and the `develop` branch would need to be updated and all "required builds" referencing the old PHPCS version would need to be removed, while new "required builds" would need to be added referencing the new minimum PHPCS version.

This was a fiddly process and time-consuming.

The change proposed in this commit takes advantage of the Composer `--prefer-lowest` setting to archive the same without a hard-coded PHPCS 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 version bumps.
@jrfnl jrfnl force-pushed the feature/ghactions-test-changes branch from df2ac17 to 957ee9e Compare March 24, 2023 11:18
Copy link
Member

@GaryJones GaryJones left a comment

Choose a reason for hiding this comment

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

@jrfnl
Copy link
Member Author

jrfnl commented Mar 27, 2023

I've updated the branch protection settings. Merging now.

@jrfnl jrfnl merged commit d742981 into develop Mar 27, 2023
@jrfnl jrfnl deleted the feature/ghactions-test-changes branch March 27, 2023 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants