Skip to content

Commit cfb32ff

Browse files
authored
[PHP] Drop PHP 7.4 & 8.0 (#90)
- Upgrade all dependencies - Refurbish code to pass CI tests again
1 parent fb16416 commit cfb32ff

File tree

92 files changed

+530
-854
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+530
-854
lines changed
File renamed without changes.

.github/workflows/checks.yml

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,53 @@ on:
66
- master
77
jobs:
88
build-source:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-22.04
1010
steps:
1111
-
1212
name: Checkout
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414
-
1515
name: Install phars
1616
run: |
1717
make install-phars
1818
-
1919
name: Upload source directory
20-
uses: actions/upload-artifact@v2
20+
uses: actions/upload-artifact@v4
2121
with:
2222
name: source
23+
include-hidden-files: true
2324
path: .
2425
php-xdebug-docker:
2526
needs:
2627
- build-source
2728
strategy:
2829
matrix:
2930
php:
30-
-
31-
version: '7.4'
32-
xdebug: '3.1.5'
33-
-
34-
version: '8.0'
35-
xdebug: '3.1.5'
3631
-
3732
version: '8.1'
38-
xdebug: '3.1.5'
33+
xdebug: '3.4.0'
3934
-
4035
version: '8.2'
41-
xdebug: '3.2.1'
42-
runs-on: ubuntu-20.04
36+
xdebug: '3.4.0'
37+
-
38+
version: '8.3'
39+
xdebug: '3.4.0'
40+
-
41+
version: '8.4'
42+
xdebug: '3.4.0'
43+
runs-on: ubuntu-22.04
4344
steps:
4445
-
4546
name: Download sources
46-
uses: actions/download-artifact@v4.1.7
47+
uses: actions/download-artifact@v4
4748
with:
4849
name: source
4950
-
5051
name: Set up Docker Buildx
51-
uses: docker/setup-buildx-action@v1
52+
uses: docker/setup-buildx-action@v3
5253
-
5354
name: Build
54-
uses: docker/build-push-action@v2
55+
uses: docker/build-push-action@v6
5556
with:
5657
context: .
5758
file: ./Dockerfile
@@ -70,53 +71,53 @@ jobs:
7071
docker save php-avro-serde:${{ matrix.php.version }} -o php-avro-serde-${{ matrix.php.version }}.tgz
7172
-
7273
name: Upload docker image
73-
uses: actions/upload-artifact@v2
74+
uses: actions/upload-artifact@v4
7475
with:
7576
name: php-avro-serde-${{ matrix.php.version }}
7677
path: php-avro-serde-${{ matrix.php.version }}.tgz
7778
ci-checks:
78-
runs-on: ubuntu-20.04
79+
runs-on: ubuntu-22.04
7980
needs:
8081
- php-xdebug-docker
8182
strategy:
8283
matrix:
8384
php:
8485
-
85-
version: '7.4'
86+
version: '8.1'
8687
composer: --prefer-lowest
8788
-
88-
version: '8.0'
89+
version: '8.2'
8990
composer: --prefer-lowest
9091
-
91-
version: '8.1'
92+
version: '8.3'
9293
composer: --prefer-lowest
9394
-
94-
version: '8.2'
95+
version: '8.4'
9596
composer: --prefer-lowest
9697
-
97-
version: '7.4'
98+
version: '8.1'
9899
composer: --prefer-stable
99100
-
100-
version: '8.0'
101+
version: '8.2'
101102
composer: --prefer-stable
102103
-
103-
version: '8.1'
104+
version: '8.3'
104105
composer: --prefer-stable
105106
-
106-
version: '8.2'
107+
version: '8.4'
107108
composer: --prefer-stable
108109
steps:
109110
-
110111
name: Download sources
111-
uses: actions/download-artifact@v4.1.7
112+
uses: actions/download-artifact@v4
112113
with:
113114
name: source
114115
-
115116
name: Set up Docker Buildx
116-
uses: docker/setup-buildx-action@v1
117+
uses: docker/setup-buildx-action@v3
117118
-
118119
name: Download docker image
119-
uses: actions/download-artifact@v4.1.7
120+
uses: actions/download-artifact@v4
120121
with:
121122
name: php-avro-serde-${{ matrix.php.version }}
122123
-
@@ -131,75 +132,73 @@ jobs:
131132
composer update --no-interaction --no-scripts --no-ansi ${{ matrix.php.composer }}
132133
-
133134
name: Run Static analysis
134-
if: ${{ matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable' }}
135+
if: ${{ matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable' }}
135136
run: |
136137
chmod a+x bin/phpstan.phar bin/php-cs-fixer.phar
137138
docker run -i --rm --net=host --sig-proxy=true --pid=host \
138139
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:${{ matrix.php.version }} \
139-
bin/phpstan.phar analyse
140+
bin/phpstan.phar analyse --memory-limit 4G
140141
docker run -i --rm --net=host --sig-proxy=true --pid=host \
141142
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:${{ matrix.php.version }} \
142143
bin/php-cs-fixer.phar fix --config=.php-cs-fixer.dist.php --diff -v --dry-run --path-mode=intersection --allow-risky=yes \
143144
src test
144145
-
145146
name: Run PHPUnit
146-
if: ${{ !(matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable') }}
147+
if: ${{ !(matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable') }}
147148
run: |
148149
docker run -i --rm --net=host --sig-proxy=true --pid=host \
149150
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:${{ matrix.php.version }} \
150151
vendor/bin/phpunit --exclude-group integration
151152
-
152153
name: Run PHPUnit with Coverage Report
153-
if: ${{ matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable' }}
154+
if: ${{ matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable' }}
154155
run: |
155156
mkdir -p build
156157
docker run -i --rm --net=host --sig-proxy=true --pid=host \
157158
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:${{ matrix.php.version }} \
158159
-d xdebug.mode=coverage vendor/bin/phpunit --exclude-group integration --coverage-clover=build/coverage.clover --coverage-text
159160
- name: Publish code coverage
160-
if: ${{ matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
161-
uses: paambaati/codeclimate-action@v3.0.0
161+
if: ${{ matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
162+
uses: paambaati/codeclimate-action@v9
162163
env:
163164
CC_TEST_REPORTER_ID: ${{secrets.CODE_CLIMATE_REPORTER_ID}}
164165
with:
165166
coverageLocations: |
166167
${{github.workspace}}/build/coverage.clover:clover
167168
confluent-integration:
168-
runs-on: ubuntu-20.04
169+
runs-on: ubuntu-22.04
169170
needs:
170171
- php-xdebug-docker
171172
strategy:
172173
matrix:
173174
confluent:
174175
-
175176
version: latest
176-
-
177-
version: 4.1.4
178177
-
179178
version: 5.5.2
180179
steps:
181180
-
182181
name: Download sources
183-
uses: actions/download-artifact@v4.1.7
182+
uses: actions/download-artifact@v4
184183
with:
185184
name: source
186185
-
187186
name: Set up Docker Buildx
188-
uses: docker/setup-buildx-action@v1
187+
uses: docker/setup-buildx-action@v3
189188
-
190189
name: Download docker image
191-
uses: actions/download-artifact@v4.1.7
190+
uses: actions/download-artifact@v4
192191
with:
193-
name: php-avro-serde-7.4
192+
name: php-avro-serde-8.3
194193
-
195194
name: Load docker image
196195
run: |
197-
docker load -i php-avro-serde-7.4.tgz
196+
docker load -i php-avro-serde-8.3.tgz
198197
-
199198
name: Install vendors
200199
run: |
201200
docker run -i --rm --net=host --sig-proxy=true --pid=host \
202-
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:7.4 \
201+
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:8.3 \
203202
composer update --no-interaction --no-scripts --no-ansi --prefer-stable
204203
-
205204
name: Run PHPUnit Integration
@@ -209,5 +208,5 @@ jobs:
209208
chmod a+x bin/wait-for-all.sh bin/wait-for-it.sh
210209
make platform
211210
docker run -i --rm --net=host --sig-proxy=true --pid=host \
212-
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:7.4 \
211+
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:8.3 \
213212
vendor/bin/phpunit --group integration

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ composer.lock
1212

1313
# Custom entries
1414
.php_cs*.cache
15-
.env
1615
variables.mk
1716
build/
1817
ocular.phar

.php-cs-fixer.dist.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all', 'strict' => false],
2424
'ordered_class_elements' => true,
2525
'php_unit_method_casing' => false,
26+
'fully_qualified_strict_types' => false,
2627
])
2728
->setFinder($finder)
28-
->setCacheFile('.php_cs.' . (string) getenv('PHP_VERSION') . '.cache')
29+
->setCacheFile('.php_cs.' . getenv('PHP_VERSION') . '.cache')
2930
->setUsingCache(true);

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG PHP_VERSION=8.1
1+
ARG PHP_VERSION=8.3
22

33
FROM php:${PHP_VERSION}-cli-alpine
44

5-
ARG XDEBUG_VERSION=3.1.5
5+
ARG XDEBUG_VERSION=3.4.0
66

77
COPY --from=composer /usr/bin/composer /usr/bin/composer
88
RUN composer --version

Makefile

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# no buildin rules and variables
1+
# no builtin rules and variables
22
MAKEFLAGS =+ -rR --warn-undefined-variables
33

4-
.PHONY: composer-install composer-update phpstan cs-fixer examples docker run
4+
.PHONY: composer-install composer-update composer-update-lowest phpstan cs-fixer examples docker run
55

66
CONFLUENT_VERSION ?= latest
77
CONFLUENT_NETWORK_SUBNET ?= 172.68.0.0/24
@@ -10,15 +10,15 @@ SCHEMA_REGISTRY_IPV4 ?= 172.68.0.103
1010
KAFKA_BROKER_IPV4 ?= 172.68.0.102
1111
ZOOKEEPER_IPV4 ?= 172.68.0.101
1212
COMPOSER ?= bin/composer.phar
13-
COMPOSER_VERSION ?= 2.3.10
13+
COMPOSER_VERSION ?= 2.8.4
1414
PHP_STAN ?= bin/phpstan.phar
15-
PHP_STAN_VERSION ?= 1.8.2
15+
PHP_STAN_VERSION ?= 2.0.4
1616
PHP_CS_FIXER ?= bin/php-cs-fixer.phar
17-
PHP_CS_FIXER_VERSION ?= 3.9.5
17+
PHP_CS_FIXER_VERSION ?= 3.65.0
1818
PHPUNIT ?= vendor/bin/phpunit
1919
PHP ?= bin/php
20-
PHP_VERSION ?= 8.1
21-
XDEBUG_VERSION ?= 3.1.5
20+
PHP_VERSION ?= 8.3
21+
XDEBUG_VERSION ?= 3.4.0
2222
XDEBUG_OPTIONS ?= -d xdebug.mode=off
2323
export
2424

@@ -36,8 +36,11 @@ composer-install:
3636
composer-update:
3737
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(COMPOSER) update --prefer-stable --no-interaction --no-progress --no-scripts
3838

39+
composer-update-lowest:
40+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(COMPOSER) update --prefer-lowest --no-interaction --no-progress --no-scripts
41+
3942
phpstan:
40-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_STAN) analyse
43+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_STAN) analyse --memory-limit 4G
4144

4245
cs-fixer:
4346
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_CS_FIXER) fix --config=.php-cs-fixer.dist.php --diff -v --dry-run \
@@ -72,14 +75,14 @@ install-phars:
7275
chmod a+x bin/phpstan.phar
7376

7477
platform:
75-
docker-compose down
76-
docker-compose up -d
78+
docker compose down
79+
docker compose up -d
7780
bin/wait-for-all.sh
7881

7982
clean:
8083
rm -rf build
81-
docker-compose down
84+
docker compose down
8285

8386
benchmark: platform
8487
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) ./vendor/bin/phpbench run benchmarks/AvroEncodingBench.php --report=aggregate --retry-threshold=5
85-
docker-compose down
88+
docker compose down

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ integrates FlixTech's [Schema Registry Client](https://github.com/flix-tech/sche
2727
This library is using the [composer package manager](https://getcomposer.org/) for PHP.
2828

2929
```bash
30-
composer require 'flix-tech/avro-serde-php:^1.6'
30+
composer require 'flix-tech/avro-serde-php:^2.2'
3131
```
3232

3333
## Quickstart

0 commit comments

Comments
 (0)