From 864ea4a35f391df14c54ca9d18565eb80e49ba6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 28 Oct 2023 17:25:30 +0200 Subject: [PATCH 1/2] Run tests on PHP 8.3 and update test suite --- .github/workflows/ci.yml | 20 +++++++++++++------- composer.json | 2 +- tests/AppTest.php | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e0a72c..c90ef47 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ jobs: - ubuntu-22.04 - windows-2022 php: + - 8.3 - 8.2 - 8.1 - 8.0 @@ -22,7 +23,7 @@ jobs: - 7.2 - 7.1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -46,6 +47,7 @@ jobs: strategy: matrix: php: + - 8.3 - 8.2 - 8.1 - 8.0 @@ -54,7 +56,7 @@ jobs: - 7.2 - 7.1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -68,6 +70,7 @@ jobs: strategy: matrix: php: + - 8.3 - 8.2 - 8.1 - 8.0 @@ -76,7 +79,7 @@ jobs: - 7.2 - 7.1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -94,7 +97,7 @@ jobs: - "Dockerfile-basics" - "Dockerfile-production" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: 8.2 @@ -113,6 +116,7 @@ jobs: strategy: matrix: php: + - 8.3-rc - 8.2 - 8.1 - 8.0 @@ -121,7 +125,7 @@ jobs: - 7.2 - 7.1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -137,6 +141,7 @@ jobs: strategy: matrix: php: + - 8.3-rc - 8.2 - 8.1 - 8.0 @@ -145,7 +150,7 @@ jobs: - 7.2 - 7.1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} @@ -160,6 +165,7 @@ jobs: strategy: matrix: php: + - 8.3 - 8.2 - 8.1 - 8.0 @@ -168,7 +174,7 @@ jobs: - 7.2 - 7.1 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} diff --git a/composer.json b/composer.json index 43275fe..e41dcb5 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "react/socket": "^1.13" }, "require-dev": { - "phpstan/phpstan": "1.10.16 || 1.4.10", + "phpstan/phpstan": "1.10.47 || 1.4.10", "phpunit/phpunit": "^9.6 || ^7.5", "psr/container": "^2 || ^1", "react/promise-timer": "^1.10" diff --git a/tests/AppTest.php b/tests/AppTest.php index d59955d..09c35f2 100644 --- a/tests/AppTest.php +++ b/tests/AppTest.php @@ -1323,7 +1323,7 @@ public function testInvokeWithMatchingRouteReturnsInternalServerErrorResponseWhe $line = __LINE__ + 2; $app->get('/users', function () { - return await(reject(new \RuntimeException('Foo'))); + await(reject(new \RuntimeException('Foo'))); }); $request = new ServerRequest('GET', 'http://localhost/users'); From 5bc6c3ce843ce66b72d221b029067fa1ae5bd081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Tue, 5 Dec 2023 19:35:31 +0100 Subject: [PATCH 2/2] Update documentation and container images to PHP 8.3 --- .github/workflows/ci.yml | 6 +++--- docs/best-practices/deployment.md | 10 +++++----- tests/Dockerfile-basics | 2 +- tests/Dockerfile-production | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c90ef47..9b91059 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,7 +100,7 @@ jobs: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.3 - run: composer install -d tests/install-as-dep/ - run: docker build -f tests/${{ matrix.dockerfile }} tests/install-as-dep/ - run: docker run -d -p 8080:8080 -v "$PWD/examples/index.php":/app/public/index.php -v "$PWD/composer.json":/app/composer.json -v "$PWD/LICENSE":/app/LICENSE -v "$PWD/tests/":/app/tests/ $(docker images -q | head -n1) @@ -116,7 +116,7 @@ jobs: strategy: matrix: php: - - 8.3-rc + - 8.3 - 8.2 - 8.1 - 8.0 @@ -141,7 +141,7 @@ jobs: strategy: matrix: php: - - 8.3-rc + - 8.3 - 8.2 - 8.1 - 8.0 diff --git a/docs/best-practices/deployment.md b/docs/best-practices/deployment.md index 2932b64..8008e27 100644 --- a/docs/best-practices/deployment.md +++ b/docs/best-practices/deployment.md @@ -220,7 +220,7 @@ If you're not already running an Apache server, you can run your X project with Apache in a temporary Docker container like this: ```bash -$ docker run -it --rm -p 80:80 -v "$PWD":/srv php:8.2-apache sh -c "rmdir /var/www/html;ln -s /srv/public /var/www/html;ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled; apache2-foreground" +$ docker run -it --rm -p 80:80 -v "$PWD":/srv php:8.3-apache sh -c "rmdir /var/www/html;ln -s /srv/public /var/www/html;ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled; apache2-foreground" ``` In order to check your web application responds as expected, you can use your @@ -304,10 +304,10 @@ limit to match your concurrency workload. On Ubuntu- or Debian-based systems, you may change your PHP configuration like this: ```bash -$ sudoedit /etc/php/8.2/cli/php.ini +$ sudoedit /etc/php/8.3/cli/php.ini ``` -```diff title="/etc/php/8.2/cli/php.ini" +```diff title="/etc/php/8.3/cli/php.ini" - memory_limit = 128M + memory_limit = -1 ``` @@ -519,7 +519,7 @@ be achieved by using a `Dockerfile` with the following contents: ```docker title="Dockerfile" # syntax=docker/dockerfile:1 - FROM php:8.2-cli + FROM php:8.3-cli WORKDIR /app/ COPY public/ public/ @@ -541,7 +541,7 @@ be achieved by using a `Dockerfile` with the following contents: COPY composer.json composer.lock ./ RUN composer install --no-dev --ignore-platform-reqs --optimize-autoloader - FROM php:8.2-alpine + FROM php:8.3-alpine # recommended: install optional extensions ext-ev and ext-sockets RUN apk --no-cache add ${PHPIZE_DEPS} libev linux-headers \ diff --git a/tests/Dockerfile-basics b/tests/Dockerfile-basics index ad7c0fe..270aa38 100644 --- a/tests/Dockerfile-basics +++ b/tests/Dockerfile-basics @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM php:8.2-cli +FROM php:8.3-cli WORKDIR /app/ COPY public/ public/ diff --git a/tests/Dockerfile-production b/tests/Dockerfile-production index fbe82c5..ccf3b48 100644 --- a/tests/Dockerfile-production +++ b/tests/Dockerfile-production @@ -8,7 +8,7 @@ COPY composer.json composer.lock ./ # dev environment already has dependencies installed: COPY vendor/ vendor/ -FROM php:8.2-alpine +FROM php:8.3-alpine # recommended: install optional extensions ext-ev and ext-sockets RUN apk --no-cache add ${PHPIZE_DEPS} libev linux-headers \