From b184743ddb226a7ea84bc7367cad750a13f721d1 Mon Sep 17 00:00:00 2001 From: Jukka Svahn Date: Tue, 2 Jan 2024 19:14:54 +0200 Subject: [PATCH] Test on PHP 8.3 --- .github/CONTRIBUTING.textile | 37 +++++++++++++++++++++++++++++++++ Makefile | 2 +- docker-compose.yml | 2 +- docker/image/php_8_3/Dockerfile | 16 ++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 docker/image/php_8_3/Dockerfile diff --git a/.github/CONTRIBUTING.textile b/.github/CONTRIBUTING.textile index f58737df..1d2c6a86 100644 --- a/.github/CONTRIBUTING.textile +++ b/.github/CONTRIBUTING.textile @@ -45,3 +45,40 @@ bc. $ make test-unit $ make test-static Tests should pass before the changes can be merged to the codebase. If you create a pull requests that does not pass tests, CI will complain in the pull request thread. To get your changes merged, you should rework the code or tests until everything works smoothly. + +h2. Running tests on different PHP versions and platforms + +The project comes with multiple different PHP versions that can be used to run the test suite. To run tests on different PHP version, first build the target image and then run tests using it: + +bc. $ make docker-build IMAGE=php_8_3 +$ make test + +List of available images can be found by running: + +bc. $ make docker-images + +h2. Creating new release + +Releasing a new stable version requires replacing version references in the project source code, committing changes and creating a new tag. To do so, first run a command to bump the version: + +bc. make bump + +This will look for upcoming header line from CHANGELOG.textile file, and use it's included version number as the released version. It will then replace version references in source files and format the CHANGELOG.textile file, adding today's date to the upcoming header line. + +You can now commit the changes and create a new tag that matches the version. Replace @0.0.0@ with your version number, make sure that the tag starts with @v@ character: + +bc. $ git add -u +$ git commit -m "Version 0.0.0" +$ git push origin +$ git tag -a v0.0.0 -m v0.0.0 +$ git push origin v0.0.0 + +There is now a new stable release available; CI will take care of creating releases to GitHub. You can then set the branch to the next development version. To do so, add a @h2. Version 0.0.0 - upcoming@ header line to CHANGELOG.textile file and run the following command: + +bc. $ make bump-dev + +This will replace version references in the source code with the one that was added to CHANGELOG.textile file. Replace @0.0.0@ with the version number you want to use. Then commit the changes: + +bc. $ git add -u +$ git commit -m "Bumped development version" +$ git push origin diff --git a/Makefile b/Makefile index 11af5677..6c546629 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ .PHONY: all clean docker-build docker-images help lint lint-fix repl test test-static test-unit bump bump-dev process-reports -IMAGE?=php_8_1 +IMAGE ?= php_8_3 PHP = docker-compose run --rm php all: test diff --git a/docker-compose.yml b/docker-compose.yml index 983c4e49..58de696f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: php: - build: ./docker/image/${IMAGE:-php_8_2} + build: ./docker/image/${IMAGE:-php_8_3} volumes: - .:/app - ${COMPOSER_HOME:-$HOME/.composer}:/tmp diff --git a/docker/image/php_8_3/Dockerfile b/docker/image/php_8_3/Dockerfile new file mode 100644 index 00000000..c2f78565 --- /dev/null +++ b/docker/image/php_8_3/Dockerfile @@ -0,0 +1,16 @@ +FROM php:8.3-cli + +RUN apt-get update && apt-get install -y \ + bash \ + git \ + libz-dev \ + zip \ + wget + +RUN pecl install xdebug-3.3.1 + +RUN docker-php-ext-enable xdebug + +COPY --from=composer:2.6 /usr/bin/composer /usr/bin/composer + +WORKDIR /app