Skip to content

Commit 4d7785e

Browse files
authored
Merge pull request #55 from keboola/ondra-php82-for-v3
Support php8 for version 3.x
2 parents ea1e00e + 7079eb7 commit 4d7785e

File tree

9 files changed

+568
-9
lines changed

9 files changed

+568
-9
lines changed

.github/workflows/push.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,21 @@ env:
99
jobs:
1010
tests:
1111
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
php_version: [ 8.2, 8.1, 8.0, 7.4 ]
1216
steps:
1317
-
1418
name: 'Check out the repo'
15-
uses: actions/checkout@v2
19+
uses: actions/checkout@v3
1620
-
1721
name: 'Docker login'
1822
if: env.DOCKERHUB_TOKEN
1923
run: 'docker login --username "$DOCKERHUB_USER" --password "$DOCKERHUB_TOKEN"'
2024
-
2125
name: 'Build image'
22-
run: 'docker build -t $APP_IMAGE .'
26+
run: 'docker build --build-arg PHP_VERSION=${{ matrix.php_version }} -t $APP_IMAGE .'
2327
-
2428
name: 'Run tests'
2529
run: 'docker run ${{env.APP_IMAGE}} composer ci'

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM php:7.4
1+
ARG PHP_VERSION=7.4
2+
3+
FROM php:${PHP_VERSION:-7.4}-cli-buster
24

35
ARG DEBIAN_FRONTEND=noninteractive
46
ARG COMPOSER_FLAGS="--prefer-dist --no-interaction"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"keboola/coding-standard": "^13.0",
3333
"php-parallel-lint/php-parallel-lint": "^1.3",
3434
"phpstan/phpstan": "^1.4",
35-
"phpunit/phpunit": ">=7.5",
35+
"phpunit/phpunit": ">=7.5 <=9.6",
3636
"phpstan/phpdoc-parser": "1.5.*"
3737
},
3838
"scripts": {

ignore-by-php-version.neon.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use PHPStan\DependencyInjection\NeonAdapter;
6+
7+
$adapter = new NeonAdapter();
8+
9+
$config = [];
10+
if (PHP_VERSION_ID >= 80000) {
11+
$config = array_merge_recursive($config, $adapter->load(__DIR__ . '/phpstan-baseline-8+.neon'));
12+
} else {
13+
$config = array_merge_recursive($config, $adapter->load(__DIR__ . '/phpstan-baseline.neon'));
14+
}
15+
16+
$config['parameters']['phpVersion'] = PHP_VERSION_ID;
17+
18+
return $config;

0 commit comments

Comments
 (0)