Skip to content

Commit 62c256c

Browse files
authored
[CI] Upgrade CI dependencies (#65)
- Remove Guzzle 6.x - Allow PHP 8.1 - Remove PHPUnit 8.x - Upgrade PHP-CS-Fixer, PHPStan and composer versions - Update xdebug version - Update & optimize GH actions - Fix docker-compose.yml for new CP versions - Increase timeout for schema registry startup
1 parent ad1a796 commit 62c256c

File tree

10 files changed

+54
-45
lines changed

10 files changed

+54
-45
lines changed

.github/workflows/checks.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ jobs:
2929
php:
3030
-
3131
version: 7.4
32-
xdebug: 2.9.8
32+
xdebug: 3.1.1
3333
-
34-
version: 7.3
35-
xdebug: 2.9.8
34+
version: 8.0
35+
xdebug: 3.1.1
3636
-
37-
version: rc
38-
xdebug: 3.0.0beta1
37+
version: 8.1-rc
38+
xdebug: 3.1.1
3939
runs-on: ubuntu-20.04
4040
steps:
4141
-
@@ -79,22 +79,22 @@ jobs:
7979
matrix:
8080
php:
8181
-
82-
version: 7.3
82+
version: 7.4
8383
composer: --prefer-lowest
8484
-
85-
version: 7.4
85+
version: 8.0
8686
composer: --prefer-lowest
8787
-
88-
version: rc
88+
version: 8.1-rc
8989
composer: --prefer-lowest
9090
-
91-
version: 7.3
91+
version: 7.4
9292
composer: --prefer-stable
9393
-
94-
version: 7.4
94+
version: 8.0
9595
composer: --prefer-stable
9696
-
97-
version: rc
97+
version: 8.1-rc
9898
composer: --prefer-stable
9999
steps:
100100
-
@@ -127,15 +127,15 @@ jobs:
127127
chmod a+x bin/phpstan.phar
128128
docker run -i --rm --net=host --sig-proxy=true --pid=host -m 4000M --entrypoint="php" \
129129
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" schema-registry-client:${{ matrix.php.version }} \
130-
-d memory_limit=4G -d xdebug.mode=off -d xdebug.coverage_enable=0 bin/phpstan.phar analyse
130+
-d memory_limit=4G -d xdebug.mode=off bin/phpstan.phar analyse
131131
-
132132
name: Run CS Fixer
133133
if: ${{ matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable' }}
134134
run: |
135135
chmod a+x bin/php-cs-fixer.phar
136136
docker run -i --rm --net=host --sig-proxy=true --pid=host -m 1000M --entrypoint="php" \
137137
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" schema-registry-client:${{ matrix.php.version }} \
138-
-d xdebug.mode=off -d xdebug.coverage_enable=0 bin/php-cs-fixer.phar fix --config=.php_cs.dist \
138+
-d xdebug.mode=off -d xdebug.coverage_enable=0 bin/php-cs-fixer.phar fix --config=.php-cs-fixer.dist.php \
139139
--diff -v --dry-run --path-mode=intersection --allow-risky=yes \
140140
src test
141141
-

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ composer.phar
1111
composer.lock
1212

1313
# Custom entries
14-
.php_cs*.cache
14+
.php-cs*.cache
1515
.env
1616
variables.mk
1717
/build/

.php_cs.dist renamed to .php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
->in('src')
77
->in('test');
88

9-
return PhpCsFixer\Config::create()
9+
return (new PhpCsFixer\Config())
1010
->setRules(
1111
[
1212
'no_unused_imports' => true,

Makefile

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
# no buildin rules and variables
22
MAKEFLAGS =+ -rR --warn-undefined-variables
33

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

66
CONFLUENT_VERSION ?= latest
77
CONFLUENT_NETWORK_SUBNET ?= 172.68.0.0/24
8+
CONFLUENT_NETWORK_GATEWAY ?= 172.68.0.1
89
SCHEMA_REGISTRY_IPV4 ?= 172.68.0.103
910
KAFKA_BROKER_IPV4 ?= 172.68.0.102
1011
ZOOKEEPER_IPV4 ?= 172.68.0.101
1112
COMPOSER ?= bin/composer.phar
12-
COMPOSER_VERSION ?= 2.0.4
13+
COMPOSER_VERSION ?= 2.1.12
14+
COMPOSER_STABILITY ?= --prefer-stable
1315
PHP_STAN ?= bin/phpstan.phar
14-
PHP_STAN_VERSION ?= 0.12.53
16+
PHP_STAN_VERSION ?= 1.1.2
1517
PHP_CS_FIXER ?= bin/php-cs-fixer.phar
18+
PHP_CS_FIXER_VERSION ?= 3.2.1
1619
PHPUNIT ?= vendor/bin/phpunit
1720
PHP ?= bin/php
18-
PHP_VERSION ?= 7.3
19-
XDEBUG_VERSION ?= 2.9.8
20-
XDEBUG_OPTIONS ?= -d xdebug.mode=off -d xdebug.coverage_enable=0
21+
PHP_VERSION ?= 7.4
22+
XDEBUG_VERSION ?= 3.1.1
23+
XDEBUG_OPTIONS ?= -d xdebug.mode=off
2124
export
2225

2326
docker:
24-
docker build \
27+
DOCKER_BUILDKIT=1 docker build \
2528
--build-arg PHP_VERSION=$(PHP_VERSION) \
2629
--build-arg XDEBUG_VERSION=$(XDEBUG_VERSION) \
2730
-t schema-registry-client:$(PHP_VERSION) \
2831
-f Dockerfile \
2932
.
3033

3134
composer-install:
32-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(COMPOSER) install --no-interaction --no-progress --no-scripts --prefer-stable
35+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(COMPOSER) install --no-interaction --no-progress --no-scripts
3336

3437
composer-update:
35-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(COMPOSER) update --no-interaction --no-progress --no-scripts --prefer-stable
38+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(COMPOSER) update --no-interaction --no-progress --no-scripts $(COMPOSER_STABILITY)
3639

3740
phpstan:
38-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_STAN) analyse
41+
PHP_VERSION=$(PHP_VERSION) $(PHP) -d memory_limit=-1 $(XDEBUG_OPTIONS) $(PHP_STAN) analyse
3942

4043
cs-fixer:
41-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_CS_FIXER) fix --config=.php_cs.dist --diff -v --dry-run \
44+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_CS_FIXER) fix --config=.php-cs-fixer.dist.php --diff -v --dry-run \
4245
--path-mode=intersection --allow-risky=yes src test
4346

4447
cs-fixer-modify:
45-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_CS_FIXER) fix --config=.php_cs.dist --diff -v \
48+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_CS_FIXER) fix --config=.php-cs-fixer.dist.php --diff -v \
4649
--path-mode=intersection --allow-risky=yes src test
4750

4851
phpunit:
4952
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHPUNIT) --exclude-group integration
5053

51-
phpunit-integration:
52-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHPUNIT) --group integration
53-
5454
coverage:
5555
mkdir -p build
5656
PHP_VERSION=$(PHP_VERSION) $(PHP) -d xdebug.mode=coverage -d xdebug.coverage_enable=1 vendor/bin/phpunit --exclude-group integration \
@@ -62,7 +62,7 @@ examples:
6262
PHP_VERSION=$(PHP_VERSION) $(PHP) examples/*
6363

6464
install-phars:
65-
curl https://cs.symfony.com/download/php-cs-fixer-v2.phar -o bin/php-cs-fixer.phar -LR -z bin/php-cs-fixer.phar
65+
curl https://github.com/FriendsOfPHP/PHP-CS-Fixer/releases/download/v$(PHP_CS_FIXER_VERSION)/php-cs-fixer.phar -o bin/php-cs-fixer.phar -LR -z bin/php-cs-fixer.phar
6666
chmod a+x bin/php-cs-fixer.phar
6767
curl https://getcomposer.org/download/$(COMPOSER_VERSION)/composer.phar -o bin/composer.phar -LR -z bin/composer.phar
6868
chmod a+x bin/composer.phar
@@ -74,6 +74,9 @@ platform:
7474
docker-compose up -d
7575
bin/wait-for-all.sh
7676

77+
platform-logs:
78+
docker-compose logs -f
79+
7780
clean:
7881
rm -rf build
7982
docker-compose down

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![Total Downloads](https://poser.pugx.org/flix-tech/confluent-schema-registry-api/downloads)](https://packagist.org/packages/flix-tech/confluent-schema-registry-api)
88
[![License](https://poser.pugx.org/flix-tech/confluent-schema-registry-api/license)](https://packagist.org/packages/flix-tech/confluent-schema-registry-api)
99

10-
A PHP 7.3+ library to consume the Confluent Schema Registry REST API. It provides low level functions to create PSR-7
10+
A PHP 7.4+ library to consume the Confluent Schema Registry REST API. It provides low level functions to create PSR-7
1111
compliant requests that can be used as well as high level abstractions to ease developer experience.
1212

1313
#### Contents
@@ -33,8 +33,8 @@ compliant requests that can be used as well as high level abstractions to ease d
3333

3434
| Dependency | Version | Reason |
3535
|:--- |:---:|:--- |
36-
| **`php`** | ~7.3 | Anything lower has reached EOL |
37-
| **`guzzlephp/guzzle`** | ~6.3 | Using `Request` to build PSR-7 `RequestInterface` |
36+
| **`php`** | ~7.4 | Anything lower has reached EOL |
37+
| **`guzzlephp/guzzle`** | ~7.0 | Using `Request` to build PSR-7 `RequestInterface` |
3838
| **`beberlei/assert`** | ~2.7\|~3.0 | The de-facto standard assertions library for PHP |
3939
| **`flix-tech/avro-php`** | ^4.1 | Maintained fork of the only Avro PHP implementation: `rg/avro-php` |
4040

bin/php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ exec docker run ${DOCKER_OPTS} --rm \
1616
-v "${COMPOSER_HOME}":/tmp/composer \
1717
-w ${PWD} \
1818
-e PHP_IDE_CONFIG="serverName=schema-registry-client" \
19+
-e PHP_CS_FIXER_IGNORE_ENV=1 \
1920
-e COMPOSER_HOME="/tmp/composer" \
2021
--net=host --sig-proxy=true --pid=host \
2122
--entrypoint="php" \

bin/wait-for-all.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ SCHEMA_REGISTRY_IPV4=${SCHEMA_REGISTRY_IPV4:-localhost}
66

77
bin/wait-for-it.sh "${ZOOKEEPER_IPV4}:2181" -t 30 -- echo "zookeeper is up"
88
bin/wait-for-it.sh "${KAFKA_BROKER_IPV4}:9092" -t 30 -- echo "kafka broker is up"
9-
bin/wait-for-it.sh "${SCHEMA_REGISTRY_IPV4}:8081" -t 30 -- echo "schema registry is up"
9+
bin/wait-for-it.sh "${SCHEMA_REGISTRY_IPV4}:8081" -t 60 -- echo "schema registry is up"

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flix-tech/confluent-schema-registry-api",
3-
"description": "A PHP 7.3+ library to consume the Confluent Schema Registry REST API.",
3+
"description": "A PHP 7.4+ library to consume the Confluent Schema Registry REST API.",
44
"minimum-stability": "stable",
55
"type": "library",
66
"license": "MIT",
@@ -11,17 +11,17 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^7.3|^8.0",
14+
"php": "^7.4|^8.0|8.1.*",
1515
"ext-curl": "*",
1616
"ext-json": "*",
17-
"guzzlehttp/guzzle": "~6.3|^7.0",
17+
"guzzlehttp/guzzle": "^7.0",
1818
"guzzlehttp/promises": "^1.4.0",
1919
"guzzlehttp/psr7": "^1.7",
2020
"beberlei/assert": "~2.7|~3.0",
2121
"flix-tech/avro-php": "^4.1"
2222
},
2323
"require-dev": {
24-
"phpunit/phpunit": "^8.2.3|^9.4.2",
24+
"phpunit/phpunit": "^9.4.2",
2525
"raphhh/trex-reflection": "~1.0",
2626
"doctrine/cache": "~1.3",
2727
"psr/cache": "^1.0",

docker-compose.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ services:
1010
ZOOKEEPER_CLIENT_PORT: 2181
1111
ZOOKEEPER_TICK_TIME: 2000
1212
networks:
13-
avro-serializer-net:
13+
schema-registry-net:
1414
ipv4_address: ${ZOOKEEPER_IPV4}
1515

1616
broker:
@@ -24,8 +24,9 @@ services:
2424
KAFKA_BROKER_ID: 1
2525
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
2626
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://172.68.0.102:9092'
27+
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
2728
networks:
28-
avro-serializer-net:
29+
schema-registry-net:
2930
ipv4_address: ${KAFKA_BROKER_IPV4}
3031

3132
schema_registry:
@@ -39,13 +40,17 @@ services:
3940
environment:
4041
SCHEMA_REGISTRY_HOST_NAME: ${SCHEMA_REGISTRY_IPV4}
4142
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: 'zookeeper:2181'
43+
SCHEMA_REGISTRY_LISTENERS: "http://${SCHEMA_REGISTRY_IPV4}:8081"
44+
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'PLAINTEXT://172.68.0.102:9092'
4245
networks:
43-
avro-serializer-net:
46+
schema-registry-net:
4447
ipv4_address: ${SCHEMA_REGISTRY_IPV4}
4548

4649
networks:
47-
avro-serializer-net:
50+
schema-registry-net:
4851
driver: bridge
4952
ipam:
53+
driver: default
5054
config:
51-
- subnet: ${CONFLUENT_NETWORK_SUBNET}
55+
- subnet: "${CONFLUENT_NETWORK_SUBNET}"
56+
gateway: "${CONFLUENT_NETWORK_GATEWAY}"

phpunit.xml.integration.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<phpunit
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/7.0/phpunit.xsd"
5+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/9.3/phpunit.xsd"
66
bootstrap="test/bootstrap.php"
77
colors="true"
88
>

0 commit comments

Comments
 (0)