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

Update PHP version to 8.1 and other updates to helpers.sh #131

Merged
merged 18 commits into from
Jun 26, 2024

Conversation

jazzsequence
Copy link
Contributor

@jazzsequence jazzsequence commented Jun 26, 2024

This PR updates the helpers.sh script's update_php function to default to a minimum of PHP 8.1 since Sage no longer supports 8.0.

The update_php function has therefore been updated to check for a minimum of 8.1 but additionally updates have been made so that update_php can be called directly from the script outside of the sage install workflow, so we can test that component separately.

BATS tests have been created to test the update_php function for all versions from 7.4 - 8.3.

This PR also makes the following minor(ish) adjustments to the sage install script workflow:

  • normalizes the generated theme names before the sage install script is called (fixes an issue where tests were failing because themes were created that included slashes in the directories that were created)
  • silences the multisite check (sends the output of the check to /dev/null so a WP-CLI warning is not thrown if the MULTISITE constant does not exist)
  • adds a check to see if the Sage theme exists before attempting to activate it

@jazzsequence jazzsequence marked this pull request as ready for review June 26, 2024 18:43
@jazzsequence jazzsequence requested review from a team as code owners June 26, 2024 18:43
@jazzsequence jazzsequence changed the title Update PHP version to 8.1 Update PHP version to 8.1 and other updates to helpers.sh Jun 26, 2024
private/scripts/helpers.sh Show resolved Hide resolved
…heck

we can also remove the conditional around activation because if it's in the list, we should be able to activate it
@jazzsequence jazzsequence merged commit eb3fe53 into default Jun 26, 2024
11 checks passed
@jazzsequence jazzsequence deleted the update-php-to-81-sage-script branch June 26, 2024 22:07
jazzsequence added a commit that referenced this pull request Jul 31, 2024
* set the default php version to 8.1

* update the update_php function to update to 8.1 at minimum

* allow the update_php function to be run independently
so we can test it

* add tests for the updated update_php function

* update the test script to add bats tests

* update the echo to be more accurate

* add more verbose inline docs

* bail if we can't copy the file

* ensure the job runner has permission to write to the filesystem

* update the sed command to work cross-platform
maybe....

* don't bail out of the script entirely in the update php script if in CI

* bail early (and don't try to activate) if the theme wasn't found

* remove line breaks or spaces from the theme name

* echo the themelist so we can see what's being grepped

* change the grep to be more inclusive

* use grep -q instead of -w

* normalize genrenated theme names

* move the messaging about the theme not being in the list up to that check
we can also remove the conditional around activation because if it's in the list, we should be able to activate it
jazzsequence added a commit that referenced this pull request Aug 1, 2024
* set the default php version to 8.1

* update the update_php function to update to 8.1 at minimum

* allow the update_php function to be run independently
so we can test it

* add tests for the updated update_php function

* update the test script to add bats tests

* update the echo to be more accurate

* add more verbose inline docs

* bail if we can't copy the file

* ensure the job runner has permission to write to the filesystem

* update the sed command to work cross-platform
maybe....

* don't bail out of the script entirely in the update php script if in CI

* bail early (and don't try to activate) if the theme wasn't found

* remove line breaks or spaces from the theme name

* echo the themelist so we can see what's being grepped

* change the grep to be more inclusive

* use grep -q instead of -w

* normalize genrenated theme names

* move the messaging about the theme not being in the list up to that check
we can also remove the conditional around activation because if it's in the list, we should be able to activate it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants