Skip to content

Commit

Permalink
Test on PHP 8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gocom committed Jan 2, 2024
1 parent 29e5a13 commit b184743
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
37 changes: 37 additions & 0 deletions .github/CONTRIBUTING.textile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions docker/image/php_8_3/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b184743

Please sign in to comment.