Skip to content

Commit b4aa5c2

Browse files
CI love
1 parent 2fa8803 commit b4aa5c2

File tree

6 files changed

+22
-7
lines changed

6 files changed

+22
-7
lines changed

.github/workflows/test-turbo.yml

+11-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
paths:
99
- 'src/Turbo/**'
1010

11+
env:
12+
SYMFONY_REQUIRE: '>=5.4'
13+
1114
jobs:
1215
phpstan:
1316
runs-on: ubuntu-latest
@@ -38,11 +41,11 @@ jobs:
3841
strategy:
3942
fail-fast: false
4043
matrix:
41-
php-version: ['8.1', '8.3']
44+
php-version: ['8.1', '8.4']
4245
include:
4346
- php-version: '8.1'
4447
dependency-version: 'lowest'
45-
- php-version: '8.3'
48+
- php-version: '8.4'
4649
dependency-version: 'highest'
4750

4851
services:
@@ -69,6 +72,9 @@ jobs:
6972
with:
7073
php-version: ${{ matrix.php-version }}
7174

75+
- name: Install symfony/flex
76+
run: composer global config allow-plugins.symfony/flex true && composer global require symfony/flex
77+
7278
- name: Install Turbo packages
7379
uses: ramsey/composer-install@v3
7480
with:
@@ -101,6 +107,8 @@ jobs:
101107

102108
- name: Run tests
103109
working-directory: src/Turbo
104-
run: vendor/bin/simple-phpunit
110+
run: |
111+
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak
112+
vendor/bin/simple-phpunit
105113
env:
106114
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=1'

src/Turbo/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"symfony/property-access": "^5.4|^6.0|^7.0",
5353
"symfony/security-core": "^5.4|^6.0|^7.0",
5454
"symfony/stopwatch": "^5.4|^6.0|^7.0",
55-
"symfony/ux-twig-component": "^2.0",
55+
"symfony/ux-twig-component": "^2.13",
5656
"symfony/twig-bundle": "^5.4|^6.0|^7.0",
5757
"symfony/web-profiler-bundle": "^5.4|^6.0|^7.0",
5858
"symfony/webpack-encore-bundle": "^2.1.1",

src/Turbo/tests/app/Kernel.php

+7
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
3939
use Symfony\UX\StimulusBundle\StimulusBundle;
4040
use Symfony\UX\Turbo\TurboBundle;
41+
use Symfony\UX\TwigComponent\TwigComponentBundle;
4142
use Symfony\WebpackEncoreBundle\WebpackEncoreBundle;
4243
use Twig\Environment;
4344

@@ -54,6 +55,7 @@ public function registerBundles(): iterable
5455
yield new DoctrineBundle();
5556
yield new TwigBundle();
5657
yield new MercureBundle();
58+
yield new TwigComponentBundle();
5759
yield new TurboBundle();
5860
yield new WebpackEncoreBundle();
5961
yield new StimulusBundle();
@@ -120,6 +122,11 @@ protected function configureContainer(ContainerConfigurator $container): void
120122
],
121123
],
122124
]);
125+
126+
$container->extension('twig_component', [
127+
'anonymous_template_directory' => 'components/',
128+
'defaults' => ['App\Twig\Components\\' => 'components/'],
129+
]);
123130
}
124131

125132
protected function configureRoutes(RoutingConfigurator $routes): void

src/Turbo/tests/app/templates/broadcast/Artist.stream.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% block create %}
22
<twig:Turbo:Stream:Append target="#artists">
3-
<div id="{{ 'artist_' ~ id }}"><a href="{{ path('artist', {id: id}) }}">{{ entity.name }} (#{{ id }})</a></div>
3+
<div id="artist_{{ id }}"><a href="{{ path('artist', {id: id}) }}">{{ entity.name }} (#{{ id }})</a></div>
44
</twig:Turbo:Stream:Append>
55
{% endblock %}
66

src/Turbo/tests/app/templates/broadcast/Book.stream.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% block create %}
22
<twig:Turbo:Stream:Append target="#books">
3-
<div id="{{ 'book_' ~ id }}">{{ entity.title }} (#{{ id }})</div>
3+
<div id="book_{{ id }}">{{ entity.title }} (#{{ id }})</div>
44
</twig:Turbo:Stream:Append>
55
{% endblock %}
66

src/Turbo/tests/app/templates/broadcast/Song.stream.html.twig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% block create %}
22
<twig:Turbo:Stream:Append target="#songs">
3-
<div id="{{ 'song_' ~ id }}">{{ entity.title }} (#{{ id }}){% if entity.artist %} by {{ entity.artist.name }} (#{{ entity.artist.id }}){% endif %}</div>
3+
<div id="song_{{ id }}">{{ entity.title }} (#{{ id }}){% if entity.artist %} by {{ entity.artist.name }} (#{{ entity.artist.id }}){% endif %}</div>
44
</twig:Turbo:Stream:Append>
55
{% endblock %}
66

0 commit comments

Comments
 (0)