Skip to content

Commit

Permalink
refactor(wp-test-runner): remove old PHP and PHPUnit, add PHP 8.3 and…
Browse files Browse the repository at this point in the history
… PHPUnit 10
  • Loading branch information
sjinks committed Dec 22, 2023
1 parent e17d066 commit 1825aa7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 7 additions & 8 deletions wp-test-runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM cimg/base:stable-20.04@sha256:35e5e29930ab565475a4f2aa9b4124998ed67dbc7b0e2dd5f420a4189d08d0d2
FROM cimg/base:current-22.04

USER root
RUN \
Expand All @@ -7,10 +7,10 @@ RUN \
apt-get -qq update && apt-get -qq install eatmydata && \
add-apt-repository -y ppa:ondrej/php && \
eatmydata apt-get -qq upgrade && \
eatmydata apt-get -qq install php7.4 php7.4-apcu php7.4-curl php7.4-gd php7.4-gmp php7.4-igbinary php7.4-imagick php7.4-imap php7.4-intl php7.4-mbstring php7.4-mysql php7.4-sqlite3 php7.4-xdebug php7.4-xml php7.4-xsl php7.4-zip php7.4-memcache php7.4-memcached && \
eatmydata apt-get -qq install php8.0 php8.0-apcu php8.0-curl php8.0-gd php8.0-gmp php8.0-igbinary php8.0-imagick php8.0-imap php8.0-intl php8.0-mbstring php8.0-mysql php8.0-sqlite3 php8.0-xdebug php8.0-xml php8.0-xsl php8.0-zip php8.0-memcache php8.0-memcached && \
eatmydata apt-get -qq install php8.1 php8.1-apcu php8.1-curl php8.1-gd php8.1-gmp php8.1-igbinary php8.1-imagick php8.1-imap php8.1-intl php8.1-mbstring php8.1-mysql php8.1-sqlite3 php8.1-xdebug php8.1-xml php8.1-zip php8.1-memcache php8.1-memcached && \
eatmydata apt-get -qq install php8.2 php8.2-curl php8.2-gd php8.2-gmp php8.2-imap php8.2-intl php8.2-mbstring php8.2-mysql php8.2-sqlite3 php8.2-xml php8.2-zip && \
eatmydata apt-get -qq install php8.2 php8.2-apcu php8.2-curl php8.2-gd php8.2-gmp php8.2-igbinary php8.2-imagick php8.2-imap php8.2-intl php8.2-mbstring php8.2-mysql php8.2-sqlite3 php8.2-xdebug php8.2-xml php8.2-zip php8.2-memcache php8.2-memcached && \
eatmydata apt-get -qq install php8.3 php8.3-apcu php8.3-curl php8.3-gd php8.3-gmp php8.3-igbinary php8.3-imagick php8.3-imap php8.3-intl php8.3-mbstring php8.3-mysql php8.3-sqlite3 php8.3-xdebug php8.3-xml php8.3-zip php8.3-memcache php8.3-memcached && \
eatmydata apt-get -qq install subversion unzip default-mysql-client && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
echo "xdebug.mode=coverage" | tee -a /etc/php/*/mods-available/xdebug.ini && \
Expand All @@ -20,12 +20,11 @@ RUN install -d -o circleci -g circleci -m 0777 /wordpress
RUN wget -q https://getcomposer.org/installer -O - | php -- --install-dir=/usr/bin/ --filename=composer

RUN \
wget -q -O /usr/local/bin/phpunit7 https://phar.phpunit.de/phpunit-7.phar & \
wget -q -O /usr/local/bin/phpunit8 https://phar.phpunit.de/phpunit-8.phar & \
wget -q -O /usr/local/bin/phpunit9 https://phar.phpunit.de/phpunit-9.phar & \
wget -q -O /usr/local/bin/phpunit9 https://phar.phpunit.de/phpunit-9.phar & \
wget -q -O /usr/local/bin/phpunit10 https://phar.phpunit.de/phpunit-10.phar & \
wget -q -O /usr/local/bin/phpcov https://phar.phpunit.de/phpcov.phar & \
wait; \
chmod +x /usr/local/bin/phpunit7 /usr/local/bin/phpunit8 /usr/local/bin/phpunit9 /usr/local/bin/phpcov
chmod +x /usr/local/bin/phpunit9 /usr/local/bin/phpunit10 /usr/local/bin/phpcov

USER circleci

Expand All @@ -44,7 +43,7 @@ COPY install-wp.sh /usr/local/bin/install-wp

USER circleci
RUN \
WP_VERSIONS=$(wget https://api.wordpress.org/core/version-check/1.7/ -q -O - | jq -r '[.offers[].version] | unique | map(select( . >= "5.5")) | .[]'); \
WP_VERSIONS=$(wget https://api.wordpress.org/core/version-check/1.7/ -q -O - | jq -r '[.offers[].version] | unique | map(select( . >= "5.9")) | .[]'); \
for version in ${WP_VERSIONS} latest; do \
install-wp "${version}" & \
done && \
Expand Down
4 changes: 2 additions & 2 deletions wp-test-runner/configure-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -e
: "${MYSQL_HOST="db"}"
: "${WP_VERSION:="latest"}"
: "${PHPUNIT_VERSION:=""}"
: "${PHP_VERSION:="7.4"}"
: "${PHP_VERSION:="8.1"}"
: "${DISABLE_XDEBUG:=""}"
: "${APP_HOME:="/home/circleci/project"}"
: "${PHP_OPTIONS:=""}"
Expand Down Expand Up @@ -52,7 +52,7 @@ elif [ -n "${PHPUNIT_VERSION}" ] && [ -x "/usr/local/bin/phpunit${PHPUNIT_VERSIO
elif [ -x "${APP_HOME}/vendor/bin/phpunit" ]; then
PHPUNIT=~/.composer/vendor/bin/phpunit
else
PHPUNIT=/usr/local/bin/phpunit7
PHPUNIT=/usr/local/bin/phpunit9
fi

echo "WordPress version: ${WP_VERSION}"
Expand Down

0 comments on commit 1825aa7

Please sign in to comment.