Skip to content

Commit

Permalink
Merge pull request #53 from keboola/adamvyborny-run-tests-on-various-…
Browse files Browse the repository at this point in the history
…php-versions

Matrix test for various PHP versions
  • Loading branch information
AdamVyborny committed Apr 6, 2023
2 parents 3e9f4f8 + f2ed7d9 commit 59dde98
Show file tree
Hide file tree
Showing 7 changed files with 527 additions and 7 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ env:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php_version: [ 8.2, 8.1, 8.0, 7.4 ]
steps:
-
name: 'Check out the repo'
uses: actions/checkout@v2
uses: actions/checkout@v3
-
name: 'Docker login'
if: env.DOCKERHUB_TOKEN
run: 'docker login --username "$DOCKERHUB_USER" --password "$DOCKERHUB_TOKEN"'
-
name: 'Build image'
run: 'docker build -t $APP_IMAGE .'
run: 'docker build --build-arg PHP_VERSION=${{ matrix.php_version }} -t $APP_IMAGE .'
-
name: 'Run tests'
run: 'docker run ${{env.APP_IMAGE}} composer ci'
run: 'docker run ${{env.APP_IMAGE}} composer ci'
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM php:7.4
ARG PHP_VERSION=7.4

FROM php:${PHP_VERSION:-7.4}

ARG DEBIAN_FRONTEND=noninteractive
ARG COMPOSER_FLAGS="--prefer-dist --no-interaction"
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"keboola/coding-standard": "^13.0",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/phpstan": "^1.4",
"phpunit/phpunit": ">=7.5",
"phpunit/phpunit": ">=7.5 <=9.6",
"phpstan/phpdoc-parser": "1.5.*"
},
"scripts": {
Expand Down
18 changes: 18 additions & 0 deletions ignore-by-php-version.neon.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

use PHPStan\DependencyInjection\NeonAdapter;

$adapter = new NeonAdapter();

$config = [];
if (PHP_VERSION_ID >= 80000) {
$config = array_merge_recursive($config, $adapter->load(__DIR__ . '/phpstan-baseline-8+.neon'));
} else {
$config = array_merge_recursive($config, $adapter->load(__DIR__ . '/phpstan-baseline.neon'));
}

$config['parameters']['phpVersion'] = PHP_VERSION_ID;

return $config;
Loading

0 comments on commit 59dde98

Please sign in to comment.