Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Upgrade to PHP 8.2 #1175

Merged
merged 7 commits into from
Nov 19, 2023
Merged
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
2 changes: 1 addition & 1 deletion .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-cli-alpine
FROM php:8.2-cli-alpine

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions zlib phar sodium tokenizer filter
Expand Down
8 changes: 4 additions & 4 deletions .docker/build
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ if [[ "$(docker images -q ghcr.io/box-project/box_php725 2> /dev/null)" == "" ]]
docker build --platform=linux/amd64 --tag=ghcr.io/box-project/box_php725 --file "${SCRIPT_DIR}/php725" .
fi

if [[ "$(docker images -q ghcr.io/box-project/box_php81 2> /dev/null)" == "" ]]; then
docker build --platform=linux/amd64 --tag=ghcr.io/box-project/box_php81 --file "${SCRIPT_DIR}/php81" .
if [[ "$(docker images -q ghcr.io/box-project/box_php82 2> /dev/null)" == "" ]]; then
docker build --platform=linux/amd64 --tag=ghcr.io/box-project/box_php82 --file "${SCRIPT_DIR}/php82" .
fi

if [[ "$(docker images -q ghcr.io/box-project/box_php81_xdebug 2> /dev/null)" == "" ]]; then
docker build --platform=linux/amd64 --tag=ghcr.io/box-project/box_php81_xdebug --file "${SCRIPT_DIR}/php81_xdebug" .
if [[ "$(docker images -q ghcr.io/box-project/box_php82_xdebug 2> /dev/null)" == "" ]]; then
docker build --platform=linux/amd64 --tag=ghcr.io/box-project/box_php82_xdebug --file "${SCRIPT_DIR}/php82_xdebug" .
fi
2 changes: 1 addition & 1 deletion .docker/php81 → .docker/php82
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-cli
FROM php:8.2-cli

RUN echo '' | \
apt-get -y update; \
Expand Down
4 changes: 2 additions & 2 deletions .docker/php81_build_phar → .docker/php82_build_phar
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-cli-alpine as build-stage
FROM php:8.2-cli-alpine as build-stage

RUN apk add --update make git

Expand All @@ -10,7 +10,7 @@ ADD . /opt/box-project/box
RUN cd /opt/box-project/box && \
make compile

FROM php:8.1-cli-alpine
FROM php:8.2-cli-alpine

COPY --from=build-stage /opt/box-project/box/bin/box.phar /usr/bin/box

Expand Down
2 changes: 1 addition & 1 deletion .docker/php81_xdebug → .docker/php82_xdebug
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-cli
FROM php:8.2-cli

RUN echo '' | \
apt-get -y update; \
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ updates:
directory: ".github/workflows"
schedule:
interval: "weekly"
groups:
dependencies:
patterns:
- "*"
8 changes: 4 additions & 4 deletions .github/workflows/auto-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand All @@ -73,7 +73,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand All @@ -95,7 +95,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ jobs:
- name: PHP 7.2.5
docker-file: .docker/php725
image-tag: ghcr.io/box-project/box_php725
- name: PHP 8.1
docker-file: .docker/php81
image-tag: ghcr.io/box-project/box_php81
- name: PHP 8.1 (Xdebug)
docker-file: .docker/php81_xdebug
image-tag: ghcr.io/box-project/box_php81_xdebug
- name: PHP 8.2
docker-file: .docker/php82
image-tag: ghcr.io/box-project/box_php82
- name: PHP 8.2 (Xdebug)
docker-file: .docker/php82_xdebug
image-tag: ghcr.io/box-project/box_php82_xdebug
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
- e2e_dockerfile_no_extension
- e2e_custom_composer_bin
- e2e_reproducible_build
php: [ '8.1', '8.2', '8.3' ]
php: [ '8.2', '8.3' ]
tools:
- 'composer:2.2'
- 'composer:2.3'
Expand Down Expand Up @@ -141,7 +141,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
ini-values: phar.readonly=0, display_errors=On, error_reporting=-1
tools: composer
coverage: pcov
Expand Down Expand Up @@ -181,8 +181,8 @@ jobs:

- name: Pull the docker image
run: |
docker pull ghcr.io/box-project/box_php81
docker pull ghcr.io/box-project/box_php81_xdebug
docker pull ghcr.io/box-project/box_php82
docker pull ghcr.io/box-project/box_php82_xdebug

- run: make ${{ matrix.e2e }}

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
ini-values: phar.readonly=0
tools: composer
coverage: none
Expand Down Expand Up @@ -127,6 +127,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.2'

- uses: actions/download-artifact@v3
with:
name: box-phar
Expand Down
29 changes: 13 additions & 16 deletions .github/workflows/requirement-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand All @@ -93,19 +93,16 @@ jobs:
# The lowest dependency is tested via an e2e test rather than by executing the tests like so.
# The reason being using tools such as PHPUnit for a version as low as the lowest supported version
# is a serious strain for close to no benefits: the e2e test is simpler.
php: [ '8.1' ]
php: [ '8.2' ]
dependency: [ locked ]
composer-options: [ null ]
composer-options: [ '' ]
include:
- php: '8.1'
- php: '8.2'
dependency: lowest
composer-options: ~
- php: '8.1'
dependency: highest
composer-options: ~
composer-options: ''
- php: '8.2'
dependency: highest
composer-options: ~
composer-options: ''
- php: '8.3'
dependency: highest
composer-options: --ignore-platform-req=php+
Expand Down Expand Up @@ -192,29 +189,29 @@ jobs:
- command: _test_e2e_pass_no_config_min_composer_php
docker-image: ghcr.io/box-project/box_php725
- command: _test_e2e_pass_no_config_min_box_php
docker-image: ghcr.io/box-project/box_php81
docker-image: ghcr.io/box-project/box_php82
- command: _test_e2e_pass_complete_min_composer_php
docker-image: ghcr.io/box-project/box_php725
- command: _test_e2e_pass_complete_min_box_php
docker-image: ghcr.io/box-project/box_php81
docker-image: ghcr.io/box-project/box_php82
- command: _test_e2e_fail_complete_min_composer_php
docker-image: ghcr.io/box-project/box_php725
- command: _test_e2e_fail_complete_min_box_php
docker-image: ghcr.io/box-project/box_php81
docker-image: ghcr.io/box-project/box_php82
- command: _test_e2e_skip_min_composer_php
docker-image: ghcr.io/box-project/box_php725
- command: _test_e2e_pass_complete_requirement_checker_not_disabled
docker-image: ghcr.io/box-project/box_php725
- command: _test_e2e_fail_conflict
docker-image: ghcr.io/box-project/box_php81
docker-image: ghcr.io/box-project/box_php82
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand Down Expand Up @@ -293,7 +290,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.2'
tools: composer
coverage: none

Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ jobs:
fail-fast: false
matrix:
php:
- version: '8.1'
- version: '8.2'
dependency: locked
composer-options: ~
- version: '8.1'
composer-options: ''
- version: '8.2'
dependency: lowest
composer-options: ~
- version: '8.1'
dependency: highest
composer-options: ~
composer-options: ''
- version: '8.2'
dependency: highest
composer-options: ~
composer-options: ''
- version: '8.3'
dependency: highest
composer-options: --ignore-platform-req=php+
Expand All @@ -52,7 +49,7 @@ jobs:
include:
- label: '; bz2 disabled'
php:
version: '8.1'
version: '8.2'
dependency: locked
composer-options: ''
tools: composer
Expand Down Expand Up @@ -94,7 +91,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [ '8.1' ]
php: [ '8.2' ]
if: github.event_name == 'pull_request' || github.event_name == 'push'
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
],
];

$config = new FidryConfig('', 81_000);
$config = new FidryConfig('', 82_000);
$config->addRules($overriddenRules);
$config->setCacheFile(__DIR__.'/dist/.php-cs-fixer.cache');
$config->setFinder($finder);
Expand Down
4 changes: 2 additions & 2 deletions Makefile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ MAKEFLAGS += --no-builtin-rules
DOCKER_RUN = docker run --interactive --platform=linux/amd64 --rm --workdir=/opt/box
DOCKER_RUN_NO_PULL = docker run --interactive --platform=linux/amd64 --rm --pull=never
# Matches the minimum PHP version supported by Box.
DOCKER_MIN_BOX_VERSION_IMAGE_TAG = ghcr.io/box-project/box_php81
DOCKER_MIN_BOX_XDEBUG_PHP_VERSION_IMAGE_TAG = ghcr.io/box-project/box_php81_xdebug
DOCKER_MIN_BOX_VERSION_IMAGE_TAG = ghcr.io/box-project/box_php82
DOCKER_MIN_BOX_XDEBUG_PHP_VERSION_IMAGE_TAG = ghcr.io/box-project/box_php82_xdebug

E2E_SCOPER_EXPOSE_SYMBOLS_DIR = fixtures/build/dir011
E2E_SCOPER_EXPOSE_SYMBOLS_OUTPUT_DIR = dist/dir011
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-iconv": "*",
"ext-mbstring": "*",
"ext-phar": "*",
"composer-plugin-api": "^2.2",
"amphp/parallel-functions": "^1.1",
"composer/semver": "^3.3.2",
"composer/xdebug-handler": "^3.0.3",
"fidry/console": "^0.5.3 || ^0.6.0",
"fidry/console": "^0.5.3",
"fidry/filesystem": "^1.1",
"humbug/php-scoper": "^0.18.6",
"justinrainbow/json-schema": "^5.2.12",
Expand Down Expand Up @@ -99,7 +99,7 @@
"ergebnis/composer-normalize": true
},
"platform": {
"php": "8.1"
"php": "8.2"
},
"platform-check": false,
"sort-packages": true
Expand Down
6 changes: 3 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion requirement-checker/Makefile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ DOCKER_MIN_COMPOSER_PHP_VERSION_IMAGE_TAG = ghcr.io/box-project/box_php725
DOCKER_MIN_COMPOSER_PHP_VERSION_RUN_COMMAND = $(DOCKER_MIN_COMPOSER_PHP_VERSION_IMAGE_TAG) php index.phar -vvv --no-ansi

# Matches the minimum PHP version supported by Box.
DOCKER_MIN_BOX_PHP_VERSION_IMAGE_TAG = ghcr.io/box-project/box_php81
DOCKER_MIN_BOX_PHP_VERSION_IMAGE_TAG = ghcr.io/box-project/box_php82
DOCKER_MIN_BOX_PHP_VERSION_RUN_COMMAND = $(DOCKER_MIN_BOX_PHP_VERSION_IMAGE_TAG) php index.phar -vvv --no-ansi

E2E_TEST_PASS_NO_CONFIG_DIR := fixtures/pass-no-config
Expand Down
Loading