From eb09176c5a3d00dcdbea85b908260ce31e82fb9a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Jun 2026 17:58:32 +0000 Subject: [PATCH 1/2] Initial plan From dba730f2303bf3902f6f031b5c336e8cdcd5f166 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Jun 2026 18:03:03 +0000 Subject: [PATCH 2/2] Add PHP 8.4/8.5 and WP 7.0 support --- .github/workflows/image.yml | 7 +++-- Dockerfile.php8.4 | 51 +++++++++++++++++++++++++++++++++++++ Dockerfile.php8.5 | 51 +++++++++++++++++++++++++++++++++++++ README.md | 22 ++++++++-------- 4 files changed, 116 insertions(+), 15 deletions(-) create mode 100644 Dockerfile.php8.4 create mode 100644 Dockerfile.php8.5 diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index a1e3f1e..7f04828 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -11,8 +11,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - wp_version: ['6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7', '6.8'] - php_version: ['7.4', '8.0', '8.1', '8.2', '8.3'] + wp_version: ['6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7', '6.8', '6.9', '7.0'] + php_version: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Checkout @@ -42,5 +42,4 @@ jobs: tags: | humanmade/plugin-tester:wp-${{ matrix.wp_version }}-php${{ matrix.php_version }} ${{ matrix.php_version == '7.4' && format('humanmade/plugin-tester:wp-{0}', matrix.wp_version) || '' }} - ${{ matrix.php_version == '7.4' && matrix.wp_version == '6.8' && 'humanmade/plugin-tester:latest' || '' }} - + ${{ matrix.php_version == '7.4' && matrix.wp_version == '7.0' && 'humanmade/plugin-tester:latest' || '' }} diff --git a/Dockerfile.php8.4 b/Dockerfile.php8.4 new file mode 100644 index 0000000..f340339 --- /dev/null +++ b/Dockerfile.php8.4 @@ -0,0 +1,51 @@ +FROM public.ecr.aws/docker/library/alpine:3.21 + +ARG WP_VERSION + +RUN apk add -u --no-cache \ + composer \ + curl \ + git \ + imagemagick \ + mysql \ + mysql-client \ + php84 \ + php84-curl \ + php84-dom \ + php84-exif \ + php84-mysqli \ + php84-pecl-imagick \ + php84-simplexml \ + php84-tokenizer \ + php84-xml \ + php84-xmlwriter + +RUN apk add --no-cache php84-pear php84-dev gcc musl-dev make \ + && pecl84 install pcov && echo extension=pcov.so > /etc/php84/conf.d/pcov.ini \ + && apk del php84-pear php84-dev gcc musl-dev make + +# Create php symlink to php84 +RUN ln -sf /usr/bin/php84 /usr/bin/php + +RUN curl -fsSL -o /tmp/wordpress.tar.gz https://wordpress.org/wordpress-${WP_VERSION}.tar.gz \ + && mkdir /wordpress \ + && tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C /wordpress \ + && rm /tmp/wordpress.tar.gz + +RUN curl -fsSL -o /tmp/wp-phpunit.tar.gz https://github.com/wp-phpunit/wp-phpunit/archive/${WP_VERSION}.0.tar.gz \ + && mkdir /wp-phpunit \ + && tar --strip-components=1 -zxmf /tmp/wp-phpunit.tar.gz -C /wp-phpunit \ + && rm /tmp/wp-phpunit.tar.gz + +RUN mysql_install_db --user=mysql --ldata=/var/lib/mysql +RUN sh -c 'mysqld_safe --datadir=/var/lib/mysql &' && sleep 4 && mysql -u root -e "CREATE DATABASE wordpress" + +ENV WP_DEVELOP_DIR=/wp-phpunit +ENV WP_PHPUNIT__TESTS_CONFIG=/wp-tests-config.php + +VOLUME ["/code"] +WORKDIR /code +COPY ./docker-entrypoint.sh /entrypoint.sh +COPY ./wp-tests-config.php /wp-tests-config.php +RUN chmod 755 /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/Dockerfile.php8.5 b/Dockerfile.php8.5 new file mode 100644 index 0000000..b0716b7 --- /dev/null +++ b/Dockerfile.php8.5 @@ -0,0 +1,51 @@ +FROM public.ecr.aws/docker/library/alpine:edge + +ARG WP_VERSION + +RUN apk add -u --no-cache \ + composer \ + curl \ + git \ + imagemagick \ + mysql \ + mysql-client \ + php85 \ + php85-curl \ + php85-dom \ + php85-exif \ + php85-mysqli \ + php85-pecl-imagick \ + php85-simplexml \ + php85-tokenizer \ + php85-xml \ + php85-xmlwriter + +RUN apk add --no-cache php85-pear php85-dev gcc musl-dev make \ + && pecl85 install pcov && echo extension=pcov.so > /etc/php85/conf.d/pcov.ini \ + && apk del php85-pear php85-dev gcc musl-dev make + +# Create php symlink to php85 +RUN ln -sf /usr/bin/php85 /usr/bin/php + +RUN curl -fsSL -o /tmp/wordpress.tar.gz https://wordpress.org/wordpress-${WP_VERSION}.tar.gz \ + && mkdir /wordpress \ + && tar --strip-components=1 -zxmf /tmp/wordpress.tar.gz -C /wordpress \ + && rm /tmp/wordpress.tar.gz + +RUN curl -fsSL -o /tmp/wp-phpunit.tar.gz https://github.com/wp-phpunit/wp-phpunit/archive/${WP_VERSION}.0.tar.gz \ + && mkdir /wp-phpunit \ + && tar --strip-components=1 -zxmf /tmp/wp-phpunit.tar.gz -C /wp-phpunit \ + && rm /tmp/wp-phpunit.tar.gz + +RUN mysql_install_db --user=mysql --ldata=/var/lib/mysql +RUN sh -c 'mysqld_safe --datadir=/var/lib/mysql &' && sleep 4 && mysql -u root -e "CREATE DATABASE wordpress" + +ENV WP_DEVELOP_DIR=/wp-phpunit +ENV WP_PHPUNIT__TESTS_CONFIG=/wp-tests-config.php + +VOLUME ["/code"] +WORKDIR /code +COPY ./docker-entrypoint.sh /entrypoint.sh +COPY ./wp-tests-config.php /wp-tests-config.php +RUN chmod 755 /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md index 8a9e9f4..9044276 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Simple Docker image for running unit tests for WordPress plugins. -**Supports multiple PHP versions:** 7.4, 8.0, 8.1, 8.2, 8.3 +**Supports multiple PHP versions:** 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5 To run the tests for your plugin, run this in your plugin directory: @@ -15,19 +15,19 @@ docker run --rm -v "$PWD:/code" humanmade/plugin-tester You can also specify a specific WordPress and PHP version combination: ```sh -docker run --rm -v "$PWD:/code" humanmade/plugin-tester:wp-6.8-php8.3 +docker run --rm -v "$PWD:/code" humanmade/plugin-tester:wp-7.0-php8.5 ``` Available tags follow the pattern `wp-{version}-php{version}`, e.g.: -- `humanmade/plugin-tester:wp-6.8-php7.4` -- `humanmade/plugin-tester:wp-6.7-php8.2` -- `humanmade/plugin-tester:wp-6.6-php8.1` +- `humanmade/plugin-tester:wp-7.0-php7.4` +- `humanmade/plugin-tester:wp-6.9-php8.4` +- `humanmade/plugin-tester:wp-6.8-php8.5` - etc. WordPress-only tags are also available (defaulting to PHP 7.4): +- `humanmade/plugin-tester:wp-7.0` +- `humanmade/plugin-tester:wp-6.9` - `humanmade/plugin-tester:wp-6.8` -- `humanmade/plugin-tester:wp-6.7` -- `humanmade/plugin-tester:wp-6.6` - etc. The `latest` tag uses the newest WordPress version with PHP 7.4. @@ -99,11 +99,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - wp_version: ['6.6', '6.7', '6.8'] - php_version: ['7.4', '8.1', '8.2', '8.3'] + wp_version: ['6.8', '6.9', '7.0'] + php_version: ['7.4', '8.3', '8.4', '8.5'] exclude: - # Exclude PHP 7.4 with WordPress 6.8 for example - - wp_version: '6.8' + # Exclude PHP 7.4 with WordPress 7.0 for example + - wp_version: '7.0' php_version: '7.4' steps: - name: Checkout code