Skip to content

Commit dc5de44

Browse files
authored
[CI] Update build env (#65)
- Remove PHP 7.3 from matrix - Update PHPStan, PHP-CS-Fixer and composer
1 parent fabd439 commit dc5de44

File tree

6 files changed

+24
-32
lines changed

6 files changed

+24
-32
lines changed

.github/workflows/checks.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,10 @@ 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
36-
-
37-
version: rc
38-
xdebug: 3.0.0beta1
34+
version: 8.0
35+
xdebug: 3.1.1
3936
runs-on: ubuntu-20.04
4037
steps:
4138
-
@@ -78,23 +75,17 @@ jobs:
7875
strategy:
7976
matrix:
8077
php:
81-
-
82-
version: 7.3
83-
composer: --prefer-lowest
8478
-
8579
version: 7.4
8680
composer: --prefer-lowest
8781
-
88-
version: rc
82+
version: 8.0
8983
composer: --prefer-lowest
90-
-
91-
version: 7.3
92-
composer: --prefer-stable
9384
-
9485
version: 7.4
9586
composer: --prefer-stable
9687
-
97-
version: rc
88+
version: 8.0
9889
composer: --prefer-stable
9990
steps:
10091
-
@@ -130,7 +121,7 @@ jobs:
130121
bin/phpstan.phar analyse
131122
docker run -i --rm --net=host --sig-proxy=true --pid=host \
132123
-v "${GITHUB_WORKSPACE}":"${GITHUB_WORKSPACE}" -w "${GITHUB_WORKSPACE}" php-avro-serde:${{ matrix.php.version }} \
133-
bin/php-cs-fixer.phar fix --config=.php_cs.dist --diff -v --dry-run --path-mode=intersection --allow-risky=yes \
124+
bin/php-cs-fixer.phar fix --config=.php-cs-fixer.dist.php --diff -v --dry-run --path-mode=intersection --allow-risky=yes \
134125
src test
135126
-
136127
name: Run PHPUnit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ variables.mk
1717
build/
1818
ocular.phar
1919
php-cs-fixer.phar
20+
phpstan.phar
2021
.phpunit.result.cache

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
->in(['src', 'test'])
77
;
88

9-
return PhpCsFixer\Config::create()
9+
return (new PhpCsFixer\Config())
1010
->setRules([
1111
'@Symfony' => true,
1212
'ordered_imports' => [
@@ -20,7 +20,7 @@
2020
'array_syntax' => ['syntax' => 'short'],
2121
'list_syntax' => ['syntax' => 'short'],
2222
'no_null_property_initialization' => true,
23-
'native_function_invocation' => true,
23+
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all', 'strict' => false],
2424
'ordered_class_elements' => true,
2525
'php_unit_method_casing' => false,
2626
])

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ARG PHP_VERSION=7.3
1+
ARG PHP_VERSION=7.4
22

33
FROM php:${PHP_VERSION}-cli-alpine
44

5-
ARG XDEBUG_VERSION=2.9.8
5+
ARG XDEBUG_VERSION=3.1.1
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
@@ -9,41 +9,41 @@ SCHEMA_REGISTRY_IPV4 ?= 192.168.104.103
99
KAFKA_BROKER_IPV4 ?= 192.168.104.102
1010
ZOOKEEPER_IPV4 ?= 192.168.104.101
1111
COMPOSER ?= bin/composer.phar
12-
COMPOSER_VERSION ?= 2.0.4
12+
COMPOSER_VERSION ?= 2.1.9
1313
PHP_STAN ?= bin/phpstan.phar
14-
PHP_STAN_VERSION ?= 0.12.53
14+
PHP_STAN_VERSION ?= 0.12.99
1515
PHP_CS_FIXER ?= bin/php-cs-fixer.phar
16-
PHP_CS_FIXER_VERSION ?= 2.18.7
16+
PHP_CS_FIXER_VERSION ?= 3.2.1
1717
PHPUNIT ?= vendor/bin/phpunit
1818
PHP ?= bin/php
19-
PHP_VERSION ?= 7.3
20-
XDEBUG_VERSION ?= 2.9.8
21-
XDEBUG_OPTIONS ?= -d xdebug.mode=off -d xdebug.coverage_enable=0
19+
PHP_VERSION ?= 7.4
20+
XDEBUG_VERSION ?= 3.1.1
21+
XDEBUG_OPTIONS ?= -d xdebug.mode=off
2222
export
2323

2424
docker:
25-
docker build \
25+
DOCKER_BUILDKIT=1 docker build \
2626
--build-arg PHP_VERSION=$(PHP_VERSION) \
2727
--build-arg XDEBUG_VERSION=$(XDEBUG_VERSION) \
2828
-t php-avro-serde:$(PHP_VERSION) \
2929
-f Dockerfile \
3030
.
3131

3232
composer-install:
33-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(COMPOSER) install --no-interaction --no-progress --no-scripts --prefer-stable
33+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(COMPOSER) install --no-interaction --no-progress --no-scripts
3434

3535
composer-update:
36-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(COMPOSER) update --no-interaction --no-progress --no-scripts --prefer-stable
36+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(COMPOSER) update --prefer-stable --no-interaction --no-progress --no-scripts
3737

3838
phpstan:
3939
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_STAN) analyse
4040

4141
cs-fixer:
42-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_CS_FIXER) fix --config=.php_cs.dist --diff -v --dry-run \
42+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_CS_FIXER) fix --config=.php-cs-fixer.dist.php --diff -v --dry-run \
4343
--path-mode=intersection --allow-risky=yes src test
4444

4545
cs-fixer-modify:
46-
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_CS_FIXER) fix --config=.php_cs.dist --diff -v \
46+
PHP_VERSION=$(PHP_VERSION) $(PHP) $(XDEBUG_OPTIONS) $(PHP_CS_FIXER) fix --config=.php-cs-fixer.dist.php --diff -v \
4747
--path-mode=intersection --allow-risky=yes src test
4848

4949
phpunit:
@@ -54,7 +54,7 @@ phpunit-integration:
5454

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

6060
ci-local: cs-fixer phpstan phpunit

bin/php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ command -v docker >/dev/null 2>&1 || { echo "docker is required to run this bina
77
USER=${USER:-$( id -un )}
88
GROUP=${GROUP:-$( id -gn )}
99
COMPOSER_HOME=${COMPOSER_HOME:-${HOME}/.composer}
10-
PHP_VERSION=${PHP_VERSION:-7.3}
10+
PHP_VERSION=${PHP_VERSION:-7.4}
1111
DOCKER_OPTS=${DOCKER_OPTS:-'-it'}
1212

1313
exec docker run ${DOCKER_OPTS} --rm \

0 commit comments

Comments
 (0)