Skip to content

Commit 934c619

Browse files
author
Cristoforo Cervino
committed
update ci
1 parent 82b76fe commit 934c619

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ jobs:
3434
- name: Constrain Symfony version
3535
run: |
3636
sed -ri 's/"symfony\/([^"]+)": "[^"]+"/"symfony\/\1": "${{ matrix.symfony-version }}"/g' composer.json
37+
# symfony/clock does not exist for 5.4 (added in 6.2); keep it installable on 5.4 jobs
38+
if [ "${{ matrix.symfony-version }}" = "5.4.*" ]; then
39+
sed -ri 's/"symfony\/clock": "[^"]+"/"symfony\/clock": "^6.2 | ^7.0"/' composer.json
40+
fi
3741
3842
- name: Constrain Doctrine ORM version
3943
run: |

tests/App/config/config.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22

33
declare(strict_types=1);
44

5+
use Composer\InstalledVersions;
56
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
6-
use Symfony\Component\HttpKernel\Kernel;
77

88
return static function (ContainerConfigurator $containerConfigurator): void {
99
$containerConfigurator->parameters()
1010
->set('kernel.secret', 'test_secret')
1111
->set('locale', 'en');
1212

13+
$frameworkBundleVersion = InstalledVersions::getVersion('symfony/framework-bundle');
1314
$frameworkConfig = [
1415
'secret' => '%kernel.secret%',
1516
'test' => true,
1617
];
17-
if (Kernel::VERSION_ID >= 60100) {
18+
if (null !== $frameworkBundleVersion && \version_compare($frameworkBundleVersion, '6.1.0', '>=')) {
1819
$frameworkConfig['http_method_override'] = false;
1920
}
20-
if (Kernel::VERSION_ID >= 60400) {
21+
if (null !== $frameworkBundleVersion && \version_compare($frameworkBundleVersion, '6.4.0', '>=')) {
2122
$frameworkConfig['handle_all_throwables'] = true;
2223
$frameworkConfig['php_errors'] = ['log' => true];
2324
}
@@ -41,7 +42,7 @@
4142
],
4243
],
4344
];
44-
if (Kernel::VERSION_ID >= 60400) {
45+
if (null !== $frameworkBundleVersion && \version_compare($frameworkBundleVersion, '6.4.0', '>=')) {
4546
$doctrineOrm['mappings']['Fixtures']['type'] = 'attribute';
4647
}
4748

0 commit comments

Comments
 (0)