Skip to content

[FT] Drop PHP 7.2 and add PHP 7.4 and 8.0 #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Nov 6, 2020
Merged
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
205 changes: 205 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
name: schema-registry-ci
on:
pull_request:
push:
branches:
- master
jobs:
build-source:
runs-on: ubuntu-20.04
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Install phars
run: |
make install-phars
-
name: Upload source directory
uses: actions/upload-artifact@v2
with:
name: source
path: .
php-xdebug-docker:
needs:
- build-source
strategy:
matrix:
php:
-
version: 7.4
xdebug: 2.9.8
-
version: 7.3
xdebug: 2.9.8
-
version: rc
xdebug: 3.0.0beta1
runs-on: ubuntu-20.04
steps:
-
name: Download sources
uses: actions/download-artifact@v2
with:
name: source
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Build
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
load: true
tags: schema-registry-client:${{ matrix.php.version }}
build-args: |
PHP_VERSION=${{ matrix.php.version }}
XDEBUG_VERSION=${{ matrix.php.xdebug }}
-
name: Inspect docker image
run: |
docker image inspect schema-registry-client:${{ matrix.php.version }}
-
name: Save docker image
run: |
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
with:
name: schema-registry-client-${{ matrix.php.version }}
path: schema-registry-client-${{ matrix.php.version }}.tgz
ci-checks:
runs-on: ubuntu-20.04
needs:
- php-xdebug-docker
strategy:
matrix:
php:
-
version: 7.3
composer: --prefer-lowest
-
version: 7.4
composer: --prefer-lowest
-
version: rc
composer: --prefer-lowest
-
version: 7.3
composer: --prefer-stable
-
version: 7.4
composer: --prefer-stable
-
version: rc
composer: --prefer-stable
steps:
-
name: Download sources
uses: actions/download-artifact@v2
with:
name: source
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Download docker image
uses: actions/download-artifact@v2
with:
name: schema-registry-client-${{ matrix.php.version }}
-
name: Load docker image
run: |
docker load -i schema-registry-client-${{ matrix.php.version }}.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:${{ matrix.php.version }} \
composer update --no-interaction --no-scripts --no-ansi ${{ matrix.php.composer }}
-
name: Run Static analysis
if: ${{ matrix.php.version == '7.4' && matrix.php.composer == '--prefer-stable' }}
run: |
chmod a+x bin/phpstan.phar bin/php-cs-fixer.phar
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 }} \
bin/phpstan.phar analyse
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 }} \
bin/php-cs-fixer.phar fix --config=.php_cs.dist --diff -v --dry-run --path-mode=intersection --allow-risky=yes \
src test
-
name: Run PHPUnit
if: ${{ !(matrix.php.version == '7.4' && 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' }}
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 }} \
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' }}
uses: paambaati/codeclimate-action@v2.7.4
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
needs:
- php-xdebug-docker
strategy:
matrix:
confluent:
-
version: latest
-
version: 4.1.4
-
version: 5.5.2
steps:
-
name: Download sources
uses: actions/download-artifact@v2
with:
name: source
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Download docker image
uses: actions/download-artifact@v2
with:
name: schema-registry-client-7.4
-
name: Load docker image
run: |
docker load -i schema-registry-client-7.4.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 \
composer update --no-interaction --no-scripts --no-ansi --prefer-stable
-
name: Run PHPUnit Integration
env:
CONFLUENT_VERSION: ${{ matrix.confluent.version }}
run: |
chmod a+x bin/wait-for-all.sh bin/wait-for-it.sh
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 \
vendor/bin/phpunit --group integration
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ variables.mk
/build/
ocular.phar
php-cs-fixer.phar
phpstan.phar

.phpunit.result.cache
147 changes: 0 additions & 147 deletions .travis.yml

This file was deleted.

21 changes: 11 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
ARG PHP_VERSION=7.2
ARG PHP_VERSION=7.4

FROM php:${PHP_VERSION}-cli-alpine

ARG XDEBUG_VERSION=2.7.2
ARG XDEBUG_VERSION=2.9.8

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

RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \
&& apk add --no-cache --virtual .runtime-deps git libzip-dev \
&& docker-php-source extract \
&& docker-php-ext-configure zip \
&& docker-php-ext-install zip \
&& pecl install xdebug-$XDEBUG_VERSION \
&& mkdir -p /usr/src/php/ext/xdebug \
&& curl -fsSL https://github.com/xdebug/xdebug/archive/$XDEBUG_VERSION.tar.gz | tar xvz -C /usr/src/php/ext/xdebug --strip 1 \
&& docker-php-ext-install xdebug \
&& docker-php-ext-enable xdebug \
&& echo "xdebug.max_nesting_level=15000" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \
&& echo "xdebug.remote_enable=true" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \
&& echo "xdebug.remote_host=localhost" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \
&& echo "xdebug.idekey=PHPSTORM" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \
&& echo "xdebug.remote_handler=dbgp" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \
&& echo "xdebug.remote_autostart=1" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \
&& echo "xdebug.remote_connect_back=0" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \
&& docker-php-source delete \
&& apk del .build-deps
Loading