Skip to content
Closed
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
82 changes: 32 additions & 50 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master
jobs:
build-source:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
-
name: Checkout
Expand All @@ -17,7 +17,7 @@ jobs:
make install-phars
-
name: Upload source directory
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v6
with:
name: source
path: .
Expand All @@ -27,23 +27,17 @@ jobs:
strategy:
matrix:
php:
-
version: '7.4'
xdebug: '3.1.5'
-
version: '8.0'
xdebug: '3.1.5'
-
version: '8.1'
xdebug: '3.1.5'
-
version: '8.2'
xdebug: '3.2.1'
runs-on: ubuntu-20.04
- version: '8.2'
xdebug: '3.5.0'
- version: '8.3'
xdebug: '3.5.0'
- version: '8.4'
xdebug: '3.5.0'
runs-on: ubuntu-24.04
steps:
-
name: Download sources
uses: actions/download-artifact@v2
uses: actions/download-artifact@v7
with:
name: source
-
Expand All @@ -70,53 +64,41 @@ jobs:
docker save schema-registry-client:${{ matrix.php.version }} -o schema-registry-client-${{ matrix.php.version }}.tgz
-
name: Upload docker image
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v6
with:
name: schema-registry-client-${{ matrix.php.version }}
path: schema-registry-client-${{ matrix.php.version }}.tgz
ci-checks:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
needs:
- php-xdebug-docker
strategy:
matrix:
php:
-
version: '7.4'
composer: --prefer-lowest
-
version: '8.0'
- version: '8.2'
composer: --prefer-lowest
-
version: '8.1'
- version: '8.3'
composer: --prefer-lowest
-
version: '8.2'
- version: '8.4'
composer: --prefer-lowest
-
version: '7.4'
- version: '8.2'
composer: --prefer-stable
-
version: '8.0'
- version: '8.3'
composer: --prefer-stable
-
version: '8.1'
composer: --prefer-stable
-
version: '8.2'
- version: '8.4'
composer: --prefer-stable
steps:
-
name: Download sources
uses: actions/download-artifact@v2
uses: actions/download-artifact@v7
with:
name: source
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Download docker image
uses: actions/download-artifact@v2
uses: actions/download-artifact@v7
with:
name: schema-registry-client-${{ matrix.php.version }}
-
Expand All @@ -131,15 +113,15 @@ jobs:
composer update --no-interaction --no-scripts --no-ansi ${{ matrix.php.composer }}
-
name: Run PHPStan analysis
if: ${{ matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable' }}
if: ${{ matrix.php.version == '8.2' && matrix.php.composer == '--prefer-stable' }}
run: |
chmod a+x bin/phpstan.phar
docker run -i --rm --net=host --sig-proxy=true --pid=host -m 4000M --entrypoint="php" \
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" schema-registry-client:${{ matrix.php.version }} \
-d memory_limit=4G -d xdebug.mode=off bin/phpstan.phar analyse
-
name: Run CS Fixer
if: ${{ matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable' }}
if: ${{ matrix.php.version == '8.2' && matrix.php.composer == '--prefer-stable' }}
run: |
chmod a+x bin/php-cs-fixer.phar
docker run -i --rm --net=host --sig-proxy=true --pid=host -m 1000M --entrypoint="php" \
Expand All @@ -149,29 +131,29 @@ jobs:
src test
-
name: Run PHPUnit
if: ${{ !(matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable') }}
if: ${{ !(matrix.php.version == '8.2' && matrix.php.composer == '--prefer-stable') }}
run: |
docker run -i --rm --net=host --sig-proxy=true --pid=host \
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" schema-registry-client:${{ matrix.php.version }} \
vendor/bin/phpunit --exclude-group integration
-
name: Run PHPUnit with Coverage Report
if: ${{ matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable' }}
if: ${{ matrix.php.version == '8.2' && matrix.php.composer == '--prefer-stable' }}
run: |
mkdir -p build
docker run -i --rm --net=host --sig-proxy=true --pid=host \
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" schema-registry-client:${{ matrix.php.version }} \
-d xdebug.mode=coverage vendor/bin/phpunit --exclude-group integration --coverage-clover=build/coverage.clover --coverage-text
- name: Publish code coverage
if: ${{ matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
if: ${{ matrix.php.version == '8.2' && matrix.php.composer == '--prefer-stable' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
uses: paambaati/codeclimate-action@v3.0.0
env:
CC_TEST_REPORTER_ID: ${{secrets.CODE_CLIMATE_REPORTER_ID}}
with:
coverageLocations: |
${{github.workspace}}/build/coverage.clover:clover
confluent-integration:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
needs:
- php-xdebug-docker
strategy:
Expand All @@ -186,26 +168,26 @@ jobs:
steps:
-
name: Download sources
uses: actions/download-artifact@v2
uses: actions/download-artifact@v7
with:
name: source
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Download docker image
uses: actions/download-artifact@v2
uses: actions/download-artifact@v7
with:
name: schema-registry-client-7.4
name: schema-registry-client-8.2
-
name: Load docker image
run: |
docker load -i schema-registry-client-7.4.tgz
docker load -i schema-registry-client-8.2.tgz
-
name: Install vendors
run: |
docker run -i --rm --net=host --sig-proxy=true --pid=host \
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" schema-registry-client:7.4 \
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" schema-registry-client:8.2 \
composer update --no-interaction --no-scripts --no-ansi --prefer-stable
-
name: Run PHPUnit Integration
Expand All @@ -216,5 +198,5 @@ jobs:
make platform
docker run -i --rm --net=host --sig-proxy=true --pid=host \
-e ENABLE_INTEGRATION_TEST=1 -e TEST_SCHEMA_REGISTRY_HOST=172.68.0.103 -e TEST_SCHEMA_REGISTRY_PORT=8081 \
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" schema-registry-client:7.4 \
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" schema-registry-client:8.2 \
vendor/bin/phpunit --group integration
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG PHP_VERSION=7.4
ARG PHP_VERSION=8.2

FROM php:${PHP_VERSION}-cli-alpine

Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ SCHEMA_REGISTRY_IPV4 ?= 172.68.0.103
KAFKA_BROKER_IPV4 ?= 172.68.0.102
ZOOKEEPER_IPV4 ?= 172.68.0.101
COMPOSER ?= bin/composer.phar
COMPOSER_VERSION ?= 2.1.12
COMPOSER_VERSION ?= 2.9.3
COMPOSER_STABILITY ?= --prefer-stable
PHP_STAN ?= bin/phpstan.phar
PHP_STAN_VERSION ?= 1.1.2
PHP_STAN_VERSION ?= 2.1.33
PHP_CS_FIXER ?= bin/php-cs-fixer.phar
PHP_CS_FIXER_VERSION ?= 3.2.1
PHP_CS_FIXER_VERSION ?= 3.92.5
PHPUNIT ?= vendor/bin/phpunit
PHP ?= bin/php
PHP_VERSION ?= 7.4
XDEBUG_VERSION ?= 3.1.1
PHP_VERSION ?= 8.2
XDEBUG_VERSION ?= 3.5.0
XDEBUG_OPTIONS ?= -d xdebug.mode=off
export

Expand Down Expand Up @@ -53,7 +53,7 @@ phpunit:

coverage:
mkdir -p build
PHP_VERSION=$(PHP_VERSION) $(PHP) -d xdebug.mode=coverage -d xdebug.coverage_enable=1 vendor/bin/phpunit --exclude-group integration \
PHP_VERSION=$(PHP_VERSION) $(PHP) -d xdebug.mode=coverage vendor/bin/phpunit --exclude-group integration \
--coverage-clover=build/coverage.clover --coverage-text

ci-local: cs-fixer phpstan phpunit
Expand Down
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flix-tech/confluent-schema-registry-api",
"description": "A PHP 7.4+ library to consume the Confluent Schema Registry REST API.",
"name": "mattiabasone/confluent-schema-registry-api",
"description": "A PHP 8.2+ library to consume the Confluent Schema Registry REST API.",
"minimum-stability": "stable",
"type": "library",
"license": "MIT",
Expand All @@ -11,22 +11,22 @@
}
],
"require": {
"php": "^7.4|^8.0",
"php": "^8.2",
"ext-curl": "*",
"ext-json": "*",
"guzzlehttp/guzzle": "^7.0",
"guzzlehttp/promises": "^1.4.0|^2.0.0",
"guzzlehttp/psr7": "^1.7|^2.1",
"guzzlehttp/promises": "^2.0.0",
"guzzlehttp/psr7": "^2.4",
"beberlei/assert": "~2.7|~3.0",
"flix-tech/avro-php": "^5.0"
"apache/avro": "dev-main"
},
"require-dev": {
"phpunit/phpunit": "^9.4.2",
"phpunit/phpunit": "^10.5",
"raphhh/trex-reflection": "~1.0",
"doctrine/cache": "~1.3",
"psr/cache": "^1.0",
"symfony/cache": "^5.1",
"psr/simple-cache": "^1.0"
"doctrine/cache": "^1.11|^2.0",
"psr/cache": "^1.13|^2.0",
"symfony/cache": "^6.4|^7.0|^8.0",
"psr/simple-cache": "^3.0"
},
"suggest": {
"doctrine/cache": "If you want to use the DoctrineCacheAdapter",
Expand Down
21 changes: 15 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="test/bootstrap.php" colors="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src/</directory>
</include>
</coverage>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="test/bootstrap.php"
colors="true"
cacheDirectory=".phpunit.cache"
displayDetailsOnTestsThatTriggerNotices="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnTestsThatTriggerErrors="true"
>
<testsuites>
<testsuite name="FlixTech Schema Registry API Test Suite">
<directory>test/</directory>
Expand All @@ -13,4 +17,9 @@
<php>
<env name="ENABLE_INTEGRATION_TEST" value="0"/>
</php>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion src/AsynchronousRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace FlixTech\SchemaRegistryApi;

use AvroSchema;
use Apache\Avro\Schema\AvroSchema;
use FlixTech\SchemaRegistryApi\Schema\AvroReference;
use GuzzleHttp\Promise\PromiseInterface;

Expand Down
2 changes: 1 addition & 1 deletion src/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace FlixTech\SchemaRegistryApi;

use AvroSchema;
use Apache\Avro\Schema\AvroSchema;
use FlixTech\SchemaRegistryApi\Exception\SchemaRegistryException;
use FlixTech\SchemaRegistryApi\Schema\AvroReference;

Expand Down
2 changes: 1 addition & 1 deletion src/Registry/BlockingRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace FlixTech\SchemaRegistryApi\Registry;

use AvroSchema;
use Apache\Avro\Schema\AvroSchema;
use Exception;
use FlixTech\SchemaRegistryApi\AsynchronousRegistry;
use FlixTech\SchemaRegistryApi\Schema\AvroReference;
Expand Down
2 changes: 1 addition & 1 deletion src/Registry/Cache/AvroObjectCacheAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace FlixTech\SchemaRegistryApi\Registry\Cache;

use AvroSchema;
use Apache\Avro\Schema\AvroSchema;
use FlixTech\SchemaRegistryApi\Registry\CacheAdapter;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Registry/Cache/CacheItemPoolAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace FlixTech\SchemaRegistryApi\Registry\Cache;

use AvroSchema;
use AvroSchemaParseException;
use Apache\Avro\Schema\AvroSchema;
use Apache\Avro\Schema\AvroSchemaParseException;
use FlixTech\SchemaRegistryApi\Registry\CacheAdapter;
use Psr\Cache\CacheItemPoolInterface;
use Symfony\Component\Cache\Exception\InvalidArgumentException;
Expand Down
4 changes: 2 additions & 2 deletions src/Registry/Cache/DoctrineCacheAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace FlixTech\SchemaRegistryApi\Registry\Cache;

use AvroSchema;
use AvroSchemaParseException;
use Apache\Avro\Schema\AvroSchema;
use Apache\Avro\Schema\AvroSchemaParseException;
use Doctrine\Common\Cache\Cache;
use FlixTech\SchemaRegistryApi\Registry\CacheAdapter;

Expand Down
4 changes: 2 additions & 2 deletions src/Registry/Cache/SimpleCacheAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace FlixTech\SchemaRegistryApi\Registry\Cache;

use AvroSchema;
use AvroSchemaParseException;
use Apache\Avro\Schema\AvroSchema;
use Apache\Avro\Schema\AvroSchemaParseException;
use FlixTech\SchemaRegistryApi\Registry\CacheAdapter;
use Psr\SimpleCache\CacheInterface;
use Symfony\Component\Cache\Exception\InvalidArgumentException;
Expand Down
2 changes: 1 addition & 1 deletion src/Registry/CacheAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace FlixTech\SchemaRegistryApi\Registry;

use AvroSchema;
use Apache\Avro\Schema\AvroSchema;

/**
* An adapter to easily add caching capabilities to the `CachedRegistry`
Expand Down
Loading