Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@

LATEST_PHP := 8.0 3.1.1
COVERAGE_PHP := 7.4 3.1.1
PHP_8_3 := 8.3 3.3.2
PHP_8_5 := 8.5 3.5.0alpha3

define PHP_VERSIONS
"7.2 3.1.1"\
"7.3 3.1.1"\
"7.4 3.1.1"\
"8.0 3.1.1"\
"8.1 3.1.1"\
"8.2 3.2.0"\
"8.3 3.3.2"\
"8.4 3.4.0beta1"
"8.1 3.4.7"\
"8.2 3.4.7"\
"8.3 3.4.7"\
"8.4 3.4.7"\
"8.5 3.5.0alpha3"
endef

define DOCKER_RUN
Expand All @@ -34,7 +35,7 @@ build: composer-update cs-check phpstan tests-all ## Run all necessary stuff bef


tests: ## Run tests on recent PHP version. Pass args to phpunit via ARGS=""
@$(call DOCKER_RUN,$(PHP_8_3),composer tests -- $(ARGS))
@$(call DOCKER_RUN,$(PHP_8_5),composer tests -- $(ARGS))


tests-coverage: ## Runs tests and creates ./clover.xml. Pass args to phpunit via ARGS=""
Expand Down Expand Up @@ -64,7 +65,7 @@ cs-fix: ## Fix code style


performance-tests: ## Run performance tests
@$(call DOCKER_RUN,$(PHP_8_3),composer performance-tests)
@$(call DOCKER_RUN,$(PHP_8_5),composer performance-tests)


composer-update: ## Validate composer.json contents
Expand Down
26 changes: 15 additions & 11 deletions build/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,30 @@ docker ps --all --format "{{.Names}}" | grep "$CONTAINER_NAME" && docker rm -f "

>&2 echo "Building $CONTAINER_NAME from $FROM_IMAGE"

# Use pecl for PHP < 8.1, pie for PHP >= 8.1
if [ "$(printf '%s\n' "8.1" "$PHP_MINOR" | sort -V | head -n1)" = "8.1" ]; then
PIE_COPY="COPY --from=ghcr.io/php/pie:bin /pie /usr/bin/pie"
XDEBUG_INSTALL="pie install xdebug/xdebug:$XDEBUG_VERSION"
else
PIE_COPY=""
XDEBUG_INSTALL="pecl install xdebug-$XDEBUG_VERSION && docker-php-ext-enable xdebug"
fi

printf "
FROM $FROM_IMAGE
RUN apk update && apk upgrade
# https://stackoverflow.com/questions/76507083/pecl-install-no-releases-available#comment136513209_76651916
RUN rm /etc/ssl/certs/ca-cert-DST_Root_CA_X3.pem || true \
&& cat /etc/ssl/certs/*.pem > /etc/ssl/certs/ca-certificates.crt \
&& cat /etc/ssl/certs/*.pem > /etc/ssl/cert.pem

$PIE_COPY

RUN apk add \
autoconf \
g++ \
libtool \
make \
bash \
linux-headers \
&& wget http://pear.php.net/go-pear.phar && php go-pear.phar \
&& pecl install xdebug-$XDEBUG_VERSION \
&& docker-php-ext-enable xdebug \
&& docker-php-ext-enable opcache \
&& wget https://getcomposer.org/download/2.8.1/composer.phar -O /usr/local/bin/composer \
&& $XDEBUG_INSTALL \
&& wget https://getcomposer.org/download/2.8.12/composer.phar -O /usr/local/bin/composer \
&& chmod +x /usr/local/bin/composer
" | docker build --quiet --tag "$CONTAINER_NAME" - > /dev/null

echo "$CONTAINER_NAME"
echo "$CONTAINER_NAME"
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"sort-packages": true
},
"require": {
"php": "7.2 - 8.4"
"php": "7.2 - 8.5"
},
"require-dev": {
"ext-json": "*",
Expand Down