Skip to content

Commit f49bb07

Browse files
committed
Add PHP 8.1, Symfony 5.4 and 6.0 ; add PHPUnit @Covers annotation
1 parent 15260a6 commit f49bb07

File tree

62 files changed

+280
-39
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+280
-39
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
php: [--php=7.4, --php=8.0]
14+
php: [--php=7.4, --php=8.0, --php=8.1]
1515
steps:
1616
- uses: actions/checkout@v2
1717
- uses: ./.github/actions/ci-env
@@ -59,7 +59,7 @@ jobs:
5959
runs-on: ubuntu-latest
6060
strategy:
6161
matrix:
62-
symfony: [--symfony=5.0, --symfony=5.1, --symfony=5.2, --symfony=5.3]
62+
symfony: [--symfony=5.0, --symfony=5.1, --symfony=5.2, --symfony=5.3, --symfony=5.4]
6363
steps:
6464
- uses: actions/checkout@v2
6565
- uses: ./.github/actions/ci-env
@@ -69,8 +69,18 @@ jobs:
6969
runs-on: ubuntu-latest
7070
strategy:
7171
matrix:
72-
symfony: [--symfony=5.0, --symfony=5.1, --symfony=5.2, --symfony=5.3]
72+
symfony: [--symfony=5.0, --symfony=5.1, --symfony=5.2, --symfony=5.3, --symfony=5.4, --symfony=6.0]
7373
steps:
7474
- uses: actions/checkout@v2
7575
- uses: ./.github/actions/ci-env
7676
- run: bin/ci/phpunit --php=8.0 ${{ matrix.symfony }}
77+
78+
phpunit-php-8-1:
79+
runs-on: ubuntu-latest
80+
strategy:
81+
matrix:
82+
symfony: [--symfony=5.0, --symfony=5.1, --symfony=5.2, --symfony=5.3, --symfony=5.4, --symfony=6.0]
83+
steps:
84+
- uses: actions/checkout@v2
85+
- uses: ./.github/actions/ci-env
86+
- run: bin/ci/phpunit --php=8.1 ${{ matrix.symfony }}

bin/ci/phpstan

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if [ "${clearCache}" == true ] && [ -d "${ROOT_DIR}"/var/ci/phpstan ]; then
2525
fi
2626

2727
if [ "${phpVersion}" == "" ]; then
28-
php8.0 "${ROOT_DIR}"/bin/ci/phpstan.php ${phpstanParameters}
28+
php8.1 "${ROOT_DIR}"/bin/ci/phpstan.php ${phpstanParameters}
2929
else
3030
echo "PHP ${phpVersion}"
3131

bin/ci/phpstan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
function createPhpstanProcesses(): ProcessArray
1717
{
18-
$phpVersions = new StringArray(['7.4', '8.0']);
18+
$phpVersions = new StringArray(['7.4', '8.0', '8.1']);
1919

2020
$return = new ProcessArray();
2121
foreach ($phpVersions as $loopPhpVersion) {

bin/ci/phpunit

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ for arg in "${@}"; do
2020
done
2121

2222
if [ "${phpVersion}" == "" ] || [ "${symfonyVersion}" == "" ]; then
23-
php8.0 "${ROOT_DIR}"/bin/ci/phpunit.php "${@}"
23+
php8.1 "${ROOT_DIR}"/bin/ci/phpunit.php "${@}"
2424
else
2525
echo "PHP ${phpVersion} - Symfony ${symfonyVersion}"
2626

@@ -29,6 +29,7 @@ else
2929
"php${phpVersion}" \
3030
vendor/bin/phpunit \
3131
--configuration config/ci/phpunit.xml \
32-
--bootstrap ${!composerHomeVarName}/vendor/autoload.php \
32+
--cache-result-file var/ci/phpunit/php-${phpVersion}/symfony-${symfonyVersion}/.phpunit.result.cache \
33+
--bootstrap "${!composerHomeVarName}"/vendor/autoload.php \
3334
${phpunitParameters}
3435
fi

bin/ci/phpunit-coverage

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ readonly ROOT_DIR="$(realpath "$(dirname "$(realpath "$0")")/../..")"
66

77
source "${ROOT_DIR}"/bin/ci/dockerise.inc.bash
88

9-
echo "PHP 8.0 - Symfony 5.3"
9+
echo "PHP 8.1 - Symfony 6.0"
1010
set +e
1111
XDEBUG_MODE=coverage \
12-
php8.0 \
12+
php8.1 \
1313
"${ROOT_DIR}"/vendor/bin/phpunit \
14-
--bootstrap "${COMPOSER_HOME_SYMFONY_5_3}"/vendor/autoload.php \
14+
--bootstrap "${COMPOSER_HOME_SYMFONY_6_0}"/vendor/autoload.php \
1515
--coverage-html "${ROOT_DIR}"/var/ci/phpunit/coverage/html \
1616
--configuration "${ROOT_DIR}"/config/ci/phpunit.xml \
1717
"${@}"

bin/ci/phpunit.php

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,35 @@
1212

1313
require dirname(__DIR__, 2) . '/vendor/autoload.php';
1414

15+
function getAvailableSymfonyVersions(string $phpVersion): StringArray
16+
{
17+
$return = new StringArray();
18+
foreach (new StringArray(['5.0', '5.1', '5.2', '5.3', '5.4', '6.0']) as $symfonyVersion) {
19+
if (isAvailable($phpVersion, $symfonyVersion)) {
20+
$return[] = $symfonyVersion;
21+
}
22+
}
23+
24+
return $return;
25+
}
26+
27+
function isAvailable(string $phpVersion, string $symfonyVersion): bool
28+
{
29+
return ($phpVersion !== '7.4' || str_starts_with($symfonyVersion, '5.'));
30+
}
31+
1532
function createPhpunitProcesses(string $phpVersion = null, string $symfonyVersion = null): ProcessArray
1633
{
17-
$phpVersions = new StringArray(is_string($phpVersion) ? [$phpVersion] : ['7.4', '8.0']);
18-
$symfonyVersions = new StringArray(is_string($symfonyVersion) ? [$symfonyVersion] : ['5.0', '5.1', '5.2', '5.3']);
34+
$phpVersions = new StringArray(is_string($phpVersion) ? [$phpVersion] : ['7.4', '8.0', '8.1']);
1935

2036
$return = new ProcessArray();
2137
foreach ($phpVersions as $loopPhpVersion) {
38+
$symfonyVersions = is_string($symfonyVersion)
39+
? [$symfonyVersion]
40+
: getAvailableSymfonyVersions($loopPhpVersion)->toArray();
41+
2242
foreach ($symfonyVersions as $loopSymfonyVersion) {
23-
if (
24-
in_array($loopPhpVersion, ['7.4', '8.0'])
25-
&& in_array($loopSymfonyVersion, ['5.0', '5.1', '5.2', '5.3'])
26-
) {
43+
if (isAvailable($loopPhpVersion, $loopSymfonyVersion)) {
2744
$return[] = createPhpunitProcess($loopPhpVersion, $loopSymfonyVersion);
2845
}
2946
}

bin/ci/validate

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ readonly ROOT_DIR="$(realpath "$(dirname "$(realpath "$0")")/../..")"
66

77
source "${ROOT_DIR}"/bin/ci/dockerise.inc.bash
88

9-
php8.0 "${ROOT_DIR}"/bin/ci/validate.php "${@}"
9+
php8.1 "${ROOT_DIR}"/bin/ci/validate.php "${@}"

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
- Rework bin/ci/shellcheck to find files to check instead of having a list
1010
- Update phpstan, add some plugins and run it for PHP 7.4 and 8.0
1111
- Use parallel-processes in `bin/start`
12+
- Allow `symfony/console` and `symfony/process` `^6.0`
13+
- Add `PHP 8.1` compatibility
1214

1315
### [0.2.1](../../compare/0.2.0...0.2.1) - 2022-01-08
1416

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"require": {
1313
"php": "^7.4 || ^8.0",
1414
"steevanb/php-typed-array": "^3.2",
15-
"symfony/console": "^5.2",
16-
"symfony/process": "^5.0"
15+
"symfony/console": "^5.2 || ^6.0",
16+
"symfony/process": "^5.0 || ^6.0"
1717
},
1818
"require-dev": {
1919
"ext-simplexml": "*",

config/ci/phpstan.php-8.1.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
includes:
2+
- phpstan.neon
3+
parameters:
4+
tmpDir: ../../var/ci/phpstan/php-8-1

0 commit comments

Comments
 (0)