Skip to content

Commit 88b294b

Browse files
author
Christian Kolb
committed
Add support for php 8.5
1 parent a287795 commit 88b294b

File tree

10 files changed

+1375
-1187
lines changed

10 files changed

+1375
-1187
lines changed

.docker/php-8.3/Dockerfile

Lines changed: 0 additions & 32 deletions
This file was deleted.

.docker/php-8.5/Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Build with
2+
# docker buildx build --platform linux/arm64,linux/amd64 -t ghcr.io/digital-craftsman-de/date-time-precision-php-8.5:latest ./.docker/php-8.5 --push
3+
4+
FROM php:8.5-fpm-alpine
5+
6+
RUN apk add --update \
7+
autoconf \
8+
g++ \
9+
automake \
10+
make \
11+
gnupg \
12+
libzip \
13+
libzip-dev \
14+
util-linux-dev \
15+
linux-headers \
16+
libuuid \
17+
$PHPIZE_DEPS \
18+
libtool \
19+
unzip
20+
21+
RUN curl -L --output /usr/bin/pie https://github.com/php/pie/releases/download/1.3.1/pie.phar \
22+
&& chmod +x /usr/bin/pie
23+
24+
# Debugging
25+
RUN pie install xdebug/xdebug
26+
27+
# Install composer
28+
RUN curl -s https://getcomposer.org/installer | php
29+
RUN alias composer='php composer.phar'
30+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
31+
32+
ADD php.ini /etc/php/conf.d/
33+
ADD php.ini /etc/php/cli/conf.d/
34+
ADD php.ini /usr/local/etc/php
35+
ADD php-fpm.conf /etc/php/php-fpm.d/
36+
ADD docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/
37+
38+
WORKDIR /var/www/html
39+
40+
CMD ["php-fpm", "-F"]

.github/workflows/ci.yml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: CI
22
on: push
33
jobs:
44

5-
test-8-3:
6-
name: "Tests on PHP 8.3"
5+
test-8-4:
6+
name: "Tests on PHP 8.4"
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@v2
@@ -18,28 +18,28 @@ jobs:
1818
- name: Setup env
1919
run: cp .github/workflows/.env .env
2020

21-
- name: Cache PHP 8.3 dependencies
22-
id: cache-php-8-3-dependencies
21+
- name: Cache PHP 8.4 dependencies
22+
id: cache-php-8-4-dependencies
2323
uses: actions/cache@v3
2424
env:
25-
cache-name: cache-php-8-3-dependencies
25+
cache-name: cache-php-8-4-dependencies
2626
with:
2727
path: |
2828
~/.cache
2929
vendor
30-
key: ${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }}
30+
key: ${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }}
3131
restore-keys: |
32-
${{ runner.os }}-php-8-3-cache-${{ hashFiles('composer.lock') }}
32+
${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }}
3333
3434
- name: Install
35-
if: steps.cache-php-8-3-dependencies.outputs.cache-hit != 'true'
36-
run: make install-8.3
35+
if: steps.cache-php-8-4-dependencies.outputs.cache-hit != 'true'
36+
run: make install-8.4
3737

3838
- name: Run PHP tests
39-
run: make php-8.3-tests-ci
39+
run: make php-8.4-tests-ci
4040

41-
test-8-4:
42-
name: "Tests on PHP 8.4"
41+
test-8-5:
42+
name: "Tests on PHP 8.5"
4343
runs-on: ubuntu-latest
4444
steps:
4545
- uses: actions/checkout@v2
@@ -54,25 +54,25 @@ jobs:
5454
- name: Setup env
5555
run: cp .github/workflows/.env .env
5656

57-
- name: Cache PHP 8.4 dependencies
58-
id: cache-php-8-4-dependencies
57+
- name: Cache PHP 8.5 dependencies
58+
id: cache-php-8-5-dependencies
5959
uses: actions/cache@v3
6060
env:
61-
cache-name: cache-php-8-4-dependencies
61+
cache-name: cache-php-8-5-dependencies
6262
with:
6363
path: |
6464
~/.cache
6565
vendor
66-
key: ${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }}
66+
key: ${{ runner.os }}-php-8-5-cache-${{ hashFiles('composer.lock') }}
6767
restore-keys: |
68-
${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }}
68+
${{ runner.os }}-php-8-5-cache-${{ hashFiles('composer.lock') }}
6969
7070
- name: Install
71-
if: steps.cache-php-8-4-dependencies.outputs.cache-hit != 'true'
72-
run: make install-8.4
71+
if: steps.cache-php-8-5-dependencies.outputs.cache-hit != 'true'
72+
run: make install-8.5
7373

7474
- name: Run PHP tests
75-
run: make php-8.4-tests-ci
75+
run: make php-8.5-tests-ci
7676

7777
- name: Upload to Codecov
7878
uses: codecov/codecov-action@v4
@@ -98,18 +98,18 @@ jobs:
9898
- name: Setup env
9999
run: cp .github/workflows/.env .env
100100

101-
- name: Restore cache for PHP 8.4 dependencies
102-
id: cache-php-8-4-dependencies
101+
- name: Restore cache for PHP 8.5 dependencies
102+
id: cache-php-8-5-dependencies
103103
uses: actions/cache/restore@v3
104104
with:
105105
path: |
106106
~/.cache
107107
vendor
108-
key: ${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }}
108+
key: ${{ runner.os }}-php-8-5-cache-${{ hashFiles('composer.lock') }}
109109

110110
- name: Install
111-
if: steps.cache-php-8-4-dependencies.outputs.cache-hit != 'true'
112-
run: make install-8.4
111+
if: steps.cache-php-8-5-dependencies.outputs.cache-hit != 'true'
112+
run: make install-8.5
113113

114114
- name: Run mutation testing
115115
run: make php-mutation-testing-ci
@@ -130,18 +130,18 @@ jobs:
130130
- name: Setup env
131131
run: cp .github/workflows/.env .env
132132

133-
- name: Restore cache for PHP 8.4 dependencies
134-
id: cache-php-8-4-dependencies
133+
- name: Restore cache for PHP 8.5 dependencies
134+
id: cache-php-8-5-dependencies
135135
uses: actions/cache/restore@v3
136136
with:
137137
path: |
138138
~/.cache
139139
vendor
140-
key: ${{ runner.os }}-php-8-4-cache-${{ hashFiles('composer.lock') }}
140+
key: ${{ runner.os }}-php-8-5-cache-${{ hashFiles('composer.lock') }}
141141

142142
- name: Install
143-
if: steps.cache-php-8-4-dependencies.outputs.cache-hit != 'true'
144-
run: make install-8.4
143+
if: steps.cache-php-8-5-dependencies.outputs.cache-hit != 'true'
144+
run: make install-8.5
145145

146146
- name: Run code validation
147147
run: make php-code-validation

Makefile

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -32,37 +32,28 @@ down: .down
3232
.down:
3333
docker compose down
3434

35-
.PHONY: update
36-
update: build up
37-
38-
.PHONY: reset
39-
reset: .reset
40-
41-
.PHONY: .reset
42-
.reset: .down .install .up
43-
4435
.PHONY: .install
45-
install: install-8.4
46-
47-
.PHONY: install-8.3
48-
install-8.3:
49-
docker compose run --rm php-8.3 composer install
36+
install: install-8.5
5037

5138
.PHONY: install-8.4
5239
install-8.4:
5340
docker compose run --rm php-8.4 composer install
5441

55-
.PHONY: .php-cli
56-
php-cli: php-8.4-cli
42+
.PHONY: install-8.5
43+
install-8.5:
44+
docker compose run --rm php-8.5 composer install
5745

58-
.PHONY: php-8.3-cli
59-
php-8.3-cli:
60-
docker compose run --rm php-8.3 sh
46+
.PHONY: .php-cli
47+
php-cli: php-8.5-cli
6148

6249
.PHONY: php-8.4-cli
6350
php-8.4-cli:
6451
docker compose run --rm php-8.4 sh
6552

53+
.PHONY: php-8.5-cli
54+
php-8.5-cli:
55+
docker compose run --rm php-8.5 sh
56+
6657
##
6758
## Tests and code quality
6859
## ----------------------
@@ -72,49 +63,49 @@ php-8.4-cli:
7263
verify: php-code-validation php-tests php-mutation-testing
7364

7465
.PHONY: php-tests
75-
php-tests: php-8.3-tests php-8.4-tests
76-
77-
.PHONY: php-8.3-tests
78-
php-8.3-tests:
79-
docker compose run --rm php-8.3 ./vendor/bin/phpunit
66+
php-tests: php-8.4-tests php-8.5-tests
8067

8168
.PHONY: php-8.4-tests
8269
php-8.4-tests:
8370
docker compose run --rm php-8.4 ./vendor/bin/phpunit
8471

85-
.PHONY: php-tests-coverage
86-
php-tests-coverage: php-8.4-tests-html-coverage
72+
.PHONY: php-8.5-tests
73+
php-8.5-tests:
74+
docker compose run --rm php-8.5 ./vendor/bin/phpunit
8775

88-
.PHONY: php-8.3-tests-html-coverage
89-
php-8.3-tests-html-coverage:
90-
docker compose run --rm php-8.3 ./vendor/bin/phpunit --coverage-html ./coverage
76+
.PHONY: php-tests-coverage
77+
php-tests-coverage: php-8.5-tests-html-coverage
9178

9279
.PHONY: php-8.4-tests-html-coverage
9380
php-8.4-tests-html-coverage:
9481
docker compose run --rm php-8.4 ./vendor/bin/phpunit --coverage-html ./coverage
9582

83+
.PHONY: php-8.5-tests-html-coverage
84+
php-8.5-tests-html-coverage:
85+
docker compose run --rm php-8.5 ./vendor/bin/phpunit --coverage-html ./coverage
86+
9687
.PHONY: php-code-validation
9788
php-code-validation:
98-
docker compose run --rm php-8.4 ./vendor/bin/php-cs-fixer fix
99-
docker compose run --rm php-8.4 ./vendor/bin/psalm --show-info=false --no-diff
89+
docker compose run --rm php-8.5 ./vendor/bin/php-cs-fixer fix
90+
docker compose run --rm php-8.5 ./vendor/bin/psalm --show-info=false --no-diff
10091

10192
.PHONY: php-mutation-testing
10293
php-mutation-testing:
103-
docker compose run --rm php-8.4 ./vendor/bin/infection --show-mutations --only-covered --threads=8
94+
docker compose run --rm php-8.5 ./vendor/bin/infection --show-mutations --only-covered --threads=8
10495

10596
##
10697
## CI
10798
## --
10899
##
109100

110-
.PHONY: php-8.3-tests-ci
111-
php-8.3-tests-ci:
112-
docker compose run --rm php-8.3 ./vendor/bin/phpunit
113-
114101
.PHONY: php-8.4-tests-ci
115102
php-8.4-tests-ci:
116-
docker compose run --rm php-8.4 ./vendor/bin/phpunit --coverage-clover ./coverage.xml
103+
docker compose run --rm php-8.4 ./vendor/bin/phpunit
104+
105+
.PHONY: php-8.5-tests-ci
106+
php-8.5-tests-ci:
107+
docker compose run --rm php-8.5 ./vendor/bin/phpunit --coverage-clover ./coverage.xml
117108

118109
.PHONY: php-mutation-testing-ci
119110
php-mutation-testing-ci:
120-
docker compose run --rm php-8.4 ./vendor/bin/infection --only-covered --threads=max
111+
docker compose run --rm php-8.5 ./vendor/bin/infection --only-covered --threads=max

composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"name": "digital-craftsman/date-time-precision",
3+
"version": "0.12.0",
34
"description": "A Symfony bundle for more precise date and time handling through value objects",
45
"type": "symfony-bundle",
56
"require": {
6-
"php": "8.3.*|8.4.*",
7-
"digital-craftsman/self-aware-normalizers": "^1.0.0",
7+
"php": "8.4.*|8.5.*",
8+
"digital-craftsman/self-aware-normalizers": "dev-php-update as 1.2.0",
89
"doctrine/dbal": "^3.4.0",
9-
"symfony/framework-bundle": "^7.0",
10-
"symfony/serializer": "^7.0"
10+
"symfony/framework-bundle": "^7.0|^8.0",
11+
"symfony/serializer": "^7.0|^8.0"
1112
},
1213
"require-dev": {
1314
"friendsofphp/php-cs-fixer": "^3.68.5",

0 commit comments

Comments
 (0)