Skip to content

Commit 39c158f

Browse files
authored
Upgrade to PHP 8.3 and PHPUnit 10 (#105)
1 parent 51476e1 commit 39c158f

File tree

6 files changed

+153
-141
lines changed

6 files changed

+153
-141
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Ignore PHPUnit bin download and run cache artifact
2-
bin/phpunit-9.phar
2+
bin/phpunit-*
33
.phpunit*.cache
44

55
# Ignore run artifacts
@@ -10,4 +10,4 @@ output.json
1010
results.xml
1111
results.json
1212

13-
*.scratch
13+
*.scratch

Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.2.7-cli-alpine3.18 AS build
1+
FROM php:8.3.4-cli-alpine3.19 AS build
22

33
RUN apk update && \
44
apk add --no-cache ca-certificates curl jo zip unzip
@@ -7,22 +7,23 @@ WORKDIR /usr/local/bin
77

88
RUN curl -L -o install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && \
99
chmod +x install-php-extensions && \
10-
install-php-extensions ds-1.4.0 intl
10+
install-php-extensions ds-1.5.0 intl
1111

12-
RUN curl -L -o phpunit-9.phar https://phar.phpunit.de/phpunit-9.phar && \
13-
chmod +x phpunit-9.phar
12+
RUN curl -L -o phpunit-10.phar https://phar.phpunit.de/phpunit-10.phar && \
13+
chmod +x phpunit-10.phar
1414

1515
WORKDIR /usr/local/bin/junit-handler/
16-
COPY --from=composer:2.5.8 /usr/bin/composer /usr/local/bin/composer
16+
COPY --from=composer:2.7.2 /usr/bin/composer /usr/local/bin/composer
1717
COPY junit-handler/ .
1818
# We need PHPUnit from junit-handler/ to run test-runner tests in CI / locally
19-
RUN composer install --no-interaction
19+
# composer warns about missing a "root version" to resolve dependencies. Fake to stop warning
20+
RUN COMPOSER_ROOT_VERSION=1.0.0 composer install --no-interaction
2021

21-
FROM php:8.2.7-cli-alpine3.18 AS runtime
22+
FROM php:8.3.4-cli-alpine3.19 AS runtime
2223

2324
COPY --from=build /usr/bin/jo /usr/bin/jo
2425
COPY --from=build /usr/local/lib/php/extensions /usr/local/lib/php/extensions
25-
COPY --from=build /usr/local/bin/phpunit-9.phar /opt/test-runner/bin/phpunit-9.phar
26+
COPY --from=build /usr/local/bin/phpunit-10.phar /opt/test-runner/bin/phpunit-10.phar
2627
COPY --from=build /usr/local/bin/junit-handler /opt/test-runner/junit-handler
2728

2829
# Use the default production configuration

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ It meets the complete spec for testing all exercises.
99

1010
### Docker image
1111

12-
The website uses isolated docker images to run untrusted code in a sandbox.
13-
The image provided by this repository consists of PHP 8.2.7 (PHPUnit 9/10).
12+
The website uses isolated Docker images to run untrusted code in a sandbox.
13+
The image provided by this repository consists of PHP 8.3.4 (PHPUnit 10).
1414
All final assets are built into the image, because the image does not have network access once in use.
1515

1616
Includes PHP extensions: ds, intl

bin/run.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
set -euo pipefail
44

5-
PHPUNIT_BIN="./bin/phpunit-9.phar"
5+
PHPUNIT_BIN="./bin/phpunit-10.phar"
66
XML_RESULTS='results.xml'
77
JSON_RESULTS='results.json'
8+
# shellcheck disable=SC2034 # Modifies XDebug behaviour when invoking PHP
9+
XDEBUG_MODE='off'
810

911
function main {
1012
local output=""
@@ -25,7 +27,6 @@ function main {
2527
output=$(eval "${PHPUNIT_BIN}" \
2628
-d memory_limit=300M \
2729
--log-junit "${output_dir%/}/${XML_RESULTS}" \
28-
--verbose \
2930
--no-configuration \
3031
--do-not-cache-result \
3132
"${test_files%%*( )}" 2>&1)

0 commit comments

Comments
 (0)