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

Fix wp-env to use proper PHP version in test matrix #79

Merged
merged 5 commits into from
Sep 10, 2024

Conversation

alecgeatches
Copy link
Contributor

@alecgeatches alecgeatches commented Sep 10, 2024

Description

See #78, which addresses a bug in 1.4.0 that should have caused test failures due to a regression. The cause of the issue is that our test matrix PHP version was being used only partially to setup depedencies and run composer:

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer

but not explicitly passed to wp-env:

- name: Setup wp-env
run: wp-env start
env:
WP_ENV_CORE: WordPress/WordPress#${{ matrix.wp }}

This PR addresses these issues:

  • We now pass the WordPress PHP version via WP_ENV_PHP_VERSION.

  • We've added an additional test test with PHP 8.0 and the latest version of WordPress, which may catch similar PHP-related changes in recent versions of WordPress features.

  • The PHP "latest" option doesn't work with wp-env as an option for WP_ENV_PHP_VERSION:

    ✖ Invalid environment variable: "WP_ENV_PHP_VERSION" must be a string of the format "X", "X.X", or "X.X.X".
    

    We're passing 8.3 explicitly instead. We'll want to keep this up to date with newer PHP versions, but this is a helpful guide for our highest tested version, which we did not explicitly test before.

@alecgeatches alecgeatches self-assigned this Sep 10, 2024
@alecgeatches alecgeatches requested a review from a team as a code owner September 10, 2024 17:48
@alecgeatches
Copy link
Contributor Author

I'm going to merge this directly to test that the changes in #78 fix the currently-broken tests. This is also a test-only change, so risk is very low.

@alecgeatches alecgeatches changed the title Add 8.0 PHP / latest WP to test matrix Fix wp-env to use proper PHP version in test matrix Sep 10, 2024
@alecgeatches alecgeatches merged commit bdc361d into trunk Sep 10, 2024
2 of 4 checks passed
@alecgeatches alecgeatches deleted the test/test-matrix branch September 10, 2024 18:31
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.

1 participant