Skip to content

Commit 8a4bbb4

Browse files
committed
[PHP] Drop PHP 7.4 & 8.0
- Upgrade all dependencies - Refurbish code to pass CI tests again
1 parent fb16416 commit 8a4bbb4

File tree

90 files changed

+510
-833
lines changed

Some content is hidden

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

90 files changed

+510
-833
lines changed

.github/workflows/checks.yml

Lines changed: 46 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ 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
2323
path: .
@@ -27,31 +27,31 @@ jobs:
2727
strategy:
2828
matrix:
2929
php:
30-
-
31-
version: '7.4'
32-
xdebug: '3.1.5'
33-
-
34-
version: '8.0'
35-
xdebug: '3.1.5'
3630
-
3731
version: '8.1'
38-
xdebug: '3.1.5'
32+
xdebug: '3.4.0'
3933
-
4034
version: '8.2'
41-
xdebug: '3.2.1'
42-
runs-on: ubuntu-20.04
35+
xdebug: '3.4.0'
36+
-
37+
version: '8.3'
38+
xdebug: '3.4.0'
39+
-
40+
version: '8.4'
41+
xdebug: '3.4.0'
42+
runs-on: ubuntu-22.04
4343
steps:
4444
-
4545
name: Download sources
46-
uses: actions/download-artifact@v4.1.7
46+
uses: actions/download-artifact@v4
4747
with:
4848
name: source
4949
-
5050
name: Set up Docker Buildx
51-
uses: docker/setup-buildx-action@v1
51+
uses: docker/setup-buildx-action@v3
5252
-
5353
name: Build
54-
uses: docker/build-push-action@v2
54+
uses: docker/build-push-action@v6
5555
with:
5656
context: .
5757
file: ./Dockerfile
@@ -70,53 +70,53 @@ jobs:
7070
docker save php-avro-serde:${{ matrix.php.version }} -o php-avro-serde-${{ matrix.php.version }}.tgz
7171
-
7272
name: Upload docker image
73-
uses: actions/upload-artifact@v2
73+
uses: actions/upload-artifact@v4
7474
with:
7575
name: php-avro-serde-${{ matrix.php.version }}
7676
path: php-avro-serde-${{ matrix.php.version }}.tgz
7777
ci-checks:
78-
runs-on: ubuntu-20.04
78+
runs-on: ubuntu-22.04
7979
needs:
8080
- php-xdebug-docker
8181
strategy:
8282
matrix:
8383
php:
8484
-
85-
version: '7.4'
85+
version: '8.1'
8686
composer: --prefer-lowest
8787
-
88-
version: '8.0'
88+
version: '8.2'
8989
composer: --prefer-lowest
9090
-
91-
version: '8.1'
91+
version: '8.3'
9292
composer: --prefer-lowest
9393
-
94-
version: '8.2'
94+
version: '8.4'
9595
composer: --prefer-lowest
9696
-
97-
version: '7.4'
97+
version: '8.1'
9898
composer: --prefer-stable
9999
-
100-
version: '8.0'
100+
version: '8.2'
101101
composer: --prefer-stable
102102
-
103-
version: '8.1'
103+
version: '8.3'
104104
composer: --prefer-stable
105105
-
106-
version: '8.2'
106+
version: '8.4'
107107
composer: --prefer-stable
108108
steps:
109109
-
110110
name: Download sources
111-
uses: actions/download-artifact@v4.1.7
111+
uses: actions/download-artifact@v4
112112
with:
113113
name: source
114114
-
115115
name: Set up Docker Buildx
116-
uses: docker/setup-buildx-action@v1
116+
uses: docker/setup-buildx-action@v3
117117
-
118118
name: Download docker image
119-
uses: actions/download-artifact@v4.1.7
119+
uses: actions/download-artifact@v4
120120
with:
121121
name: php-avro-serde-${{ matrix.php.version }}
122122
-
@@ -131,75 +131,76 @@ jobs:
131131
composer update --no-interaction --no-scripts --no-ansi ${{ matrix.php.composer }}
132132
-
133133
name: Run Static analysis
134-
if: ${{ matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable' }}
134+
if: ${{ matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable' }}
135135
run: |
136136
chmod a+x bin/phpstan.phar bin/php-cs-fixer.phar
137+
cp .env.dist .env
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: |
149+
cp .env.dist .env
148150
docker run -i --rm --net=host --sig-proxy=true --pid=host \
149151
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:${{ matrix.php.version }} \
150152
vendor/bin/phpunit --exclude-group integration
151153
-
152154
name: Run PHPUnit with Coverage Report
153-
if: ${{ matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable' }}
155+
if: ${{ matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable' }}
154156
run: |
155157
mkdir -p build
158+
cp .env.dist .env
156159
docker run -i --rm --net=host --sig-proxy=true --pid=host \
157160
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:${{ matrix.php.version }} \
158161
-d xdebug.mode=coverage vendor/bin/phpunit --exclude-group integration --coverage-clover=build/coverage.clover --coverage-text
159162
- 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
163+
if: ${{ matrix.php.version == '8.3' && matrix.php.composer == '--prefer-stable' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
164+
uses: paambaati/codeclimate-action@v9
162165
env:
163166
CC_TEST_REPORTER_ID: ${{secrets.CODE_CLIMATE_REPORTER_ID}}
164167
with:
165168
coverageLocations: |
166169
${{github.workspace}}/build/coverage.clover:clover
167170
confluent-integration:
168-
runs-on: ubuntu-20.04
171+
runs-on: ubuntu-22.04
169172
needs:
170173
- php-xdebug-docker
171174
strategy:
172175
matrix:
173176
confluent:
174177
-
175178
version: latest
176-
-
177-
version: 4.1.4
178179
-
179180
version: 5.5.2
180181
steps:
181182
-
182183
name: Download sources
183-
uses: actions/download-artifact@v4.1.7
184+
uses: actions/download-artifact@v4
184185
with:
185186
name: source
186187
-
187188
name: Set up Docker Buildx
188-
uses: docker/setup-buildx-action@v1
189+
uses: docker/setup-buildx-action@v3
189190
-
190191
name: Download docker image
191-
uses: actions/download-artifact@v4.1.7
192+
uses: actions/download-artifact@v4
192193
with:
193-
name: php-avro-serde-7.4
194+
name: php-avro-serde-8.3
194195
-
195196
name: Load docker image
196197
run: |
197-
docker load -i php-avro-serde-7.4.tgz
198+
docker load -i php-avro-serde-8.3.tgz
198199
-
199200
name: Install vendors
200201
run: |
201202
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 \
203+
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:8.3 \
203204
composer update --no-interaction --no-scripts --no-ansi --prefer-stable
204205
-
205206
name: Run PHPUnit Integration
@@ -208,6 +209,7 @@ jobs:
208209
run: |
209210
chmod a+x bin/wait-for-all.sh bin/wait-for-it.sh
210211
make platform
212+
cp .env.dist .env
211213
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 \
214+
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:8.3 \
213215
vendor/bin/phpunit --group integration

.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: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -37,7 +37,7 @@ composer-update:
3737
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(COMPOSER) update --prefer-stable --no-interaction --no-progress --no-scripts
3838

3939
phpstan:
40-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_STAN) analyse
40+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_STAN) analyse --memory-limit 4G
4141

4242
cs-fixer:
4343
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_CS_FIXER) fix --config=.php-cs-fixer.dist.php --diff -v --dry-run \
@@ -48,10 +48,10 @@ cs-fixer-modify:
4848
--path-mode=intersection --allow-risky=yes src test
4949

5050
phpunit:
51-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHPUNIT) --exclude-group integration
51+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHPUNIT) --display-phpunit-deprecations --exclude-group integration
5252

5353
phpunit-integration:
54-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHPUNIT) --group integration
54+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHPUNIT) --display-phpunit-deprecations --group integration
5555

5656
coverage:
5757
mkdir -p build
@@ -72,14 +72,14 @@ install-phars:
7272
chmod a+x bin/phpstan.phar
7373

7474
platform:
75-
docker-compose down
76-
docker-compose up -d
75+
docker compose down
76+
docker compose up -d
7777
bin/wait-for-all.sh
7878

7979
clean:
8080
rm -rf build
81-
docker-compose down
81+
docker compose down
8282

8383
benchmark: platform
8484
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) ./vendor/bin/phpbench run benchmarks/AvroEncodingBench.php --report=aggregate --retry-threshold=5
85-
docker-compose down
85+
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)