forked from researchgate/avro-php
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PHP] Drop PHP 7 & upgrade dependency versions & GH Actions (#24)
- Loading branch information
Showing
11 changed files
with
162 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
name: avro-php | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
build-source: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
- | ||
name: Install phars | ||
run: | | ||
make install-phars | ||
- | ||
name: Upload source directory | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: source | ||
include-hidden-files: true | ||
path: . | ||
php-xdebug-docker: | ||
needs: | ||
- build-source | ||
strategy: | ||
matrix: | ||
php: | ||
- | ||
version: '8.1' | ||
xdebug: '3.4.0' | ||
- | ||
version: '8.2' | ||
xdebug: '3.4.0' | ||
- | ||
version: '8.3' | ||
xdebug: '3.4.0' | ||
- | ||
version: '8.4' | ||
xdebug: '3.4.0' | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- | ||
name: Download sources | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: source | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Build | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
load: true | ||
tags: avro-php:${{ matrix.php.version }} | ||
build-args: | | ||
PHP_VERSION=${{ matrix.php.version }} | ||
XDEBUG_VERSION=${{ matrix.php.xdebug }} | ||
- | ||
name: Inspect docker image | ||
run: | | ||
docker image inspect avro-php:${{ matrix.php.version }} | ||
- | ||
name: Save docker image | ||
run: | | ||
docker save avro-php:${{ matrix.php.version }} -o php-avro-serde-${{ matrix.php.version }}.tgz | ||
- | ||
name: Upload docker image | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: php-avro-serde-${{ matrix.php.version }} | ||
path: php-avro-serde-${{ matrix.php.version }}.tgz | ||
ci-checks: | ||
runs-on: ubuntu-22.04 | ||
needs: | ||
- php-xdebug-docker | ||
strategy: | ||
matrix: | ||
php: | ||
- | ||
version: '8.1' | ||
composer: --prefer-stable | ||
- | ||
version: '8.2' | ||
composer: --prefer-stable | ||
- | ||
version: '8.3' | ||
composer: --prefer-stable | ||
- | ||
version: '8.4' | ||
composer: --prefer-stable | ||
steps: | ||
- | ||
name: Download sources | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: source | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- | ||
name: Download docker image | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: php-avro-serde-${{ matrix.php.version }} | ||
- | ||
name: Load docker image | ||
run: | | ||
docker load -i php-avro-serde-${{ 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}" avro-php:${{ matrix.php.version }} \ | ||
composer update --no-interaction --no-scripts --no-ansi ${{ matrix.php.composer }} | ||
- | ||
name: Run PHPUnit | ||
run: | | ||
mkdir -p build/tmp build/share/test/schemas build/build/interop/data | ||
chmod -R a+w build | ||
docker run -i --rm --net=host --sig-proxy=true --pid=host \ | ||
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" avro-php:${{ matrix.php.version }} \ | ||
vendor/bin/phpunit --exclude-group integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,28 @@ | ||
ARG PHP_VERSION=8.2 | ||
ARG PHP_VERSION=8.1 | ||
|
||
FROM php:${PHP_VERSION}-cli-alpine | ||
|
||
ARG XDEBUG_VERSION=3.2.0 | ||
RUN apk add --update linux-headers \ | ||
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS \ | ||
ARG XDEBUG_VERSION=3.4.0 | ||
|
||
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 gmp-dev \ | ||
&& docker-php-source extract \ | ||
&& docker-php-ext-configure zip \ | ||
&& docker-php-ext-install zip gmp \ | ||
&& pecl install xdebug-$XDEBUG_VERSION \ | ||
&& apk add --update linux-headers \ | ||
&& 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.client_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.mode=develop" >> "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini" \ | ||
&& git clone --recursive --depth=1 https://github.com/kjdev/php-ext-snappy.git \ | ||
&& cd php-ext-snappy \ | ||
&& phpize \ | ||
&& ./configure \ | ||
&& make \ | ||
&& make install \ | ||
&& docker-php-ext-enable snappy \ | ||
&& docker-php-source delete \ | ||
&& apk del .build-deps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.