Skip to content

Commit

Permalink
CI love
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-grekas authored and Kocal committed Oct 2, 2024
1 parent 356dbc2 commit bfdbb46
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/test-turbo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
paths:
- 'src/Turbo/**'

env:
SYMFONY_REQUIRE: '>=5.4'

jobs:
phpstan:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -38,11 +41,11 @@ jobs:
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.3']
php-version: ['8.1', '8.4']
include:
- php-version: '8.1'
dependency-version: 'lowest'
- php-version: '8.3'
- php-version: '8.4'
dependency-version: 'highest'

services:
Expand All @@ -69,6 +72,9 @@ jobs:
with:
php-version: ${{ matrix.php-version }}

- name: Install symfony/flex
run: composer global config allow-plugins.symfony/flex true && composer global require symfony/flex

- name: Install Turbo packages
uses: ramsey/composer-install@v3
with:
Expand Down Expand Up @@ -101,6 +107,8 @@ jobs:

- name: Run tests
working-directory: src/Turbo
run: vendor/bin/simple-phpunit
run: |
[ 'lowest' = '${{ matrix.dependency-version }}' ] && export SYMFONY_DEPRECATIONS_HELPER=weak
vendor/bin/simple-phpunit
env:
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=1'
2 changes: 1 addition & 1 deletion src/Turbo/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"symfony/property-access": "^5.4|^6.0|^7.0",
"symfony/security-core": "^5.4|^6.0|^7.0",
"symfony/stopwatch": "^5.4|^6.0|^7.0",
"symfony/ux-twig-component": "^2.0",
"symfony/ux-twig-component": "^2.21",
"symfony/twig-bundle": "^5.4|^6.0|^7.0",
"symfony/web-profiler-bundle": "^5.4|^6.0|^7.0",
"symfony/webpack-encore-bundle": "^2.1.1",
Expand Down
7 changes: 7 additions & 0 deletions src/Turbo/tests/app/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Symfony\UX\StimulusBundle\StimulusBundle;
use Symfony\UX\Turbo\TurboBundle;
use Symfony\UX\TwigComponent\TwigComponentBundle;
use Symfony\WebpackEncoreBundle\WebpackEncoreBundle;
use Twig\Environment;

Expand All @@ -54,6 +55,7 @@ public function registerBundles(): iterable
yield new DoctrineBundle();
yield new TwigBundle();
yield new MercureBundle();
yield new TwigComponentBundle();
yield new TurboBundle();
yield new WebpackEncoreBundle();
yield new StimulusBundle();
Expand Down Expand Up @@ -120,6 +122,11 @@ protected function configureContainer(ContainerConfigurator $container): void
],
],
]);

$container->extension('twig_component', [
'anonymous_template_directory' => 'components/',
'defaults' => ['App\Twig\Components\\' => 'components/'],
]);
}

protected function configureRoutes(RoutingConfigurator $routes): void
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% block create %}
<twig:Turbo:Stream:Append target="#artists">
<div id="{{ 'artist_' ~ id }}"><a href="{{ path('artist', {id: id}) }}">{{ entity.name }} (#{{ id }})</a></div>
<div id="artist_{{ id }}"><a href="{{ path('artist', {id: id}) }}">{{ entity.name }} (#{{ id }})</a></div>
</twig:Turbo:Stream:Append>
{% endblock %}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% block create %}
<twig:Turbo:Stream:Append target="#books">
<div id="{{ 'book_' ~ id }}">{{ entity.title }} (#{{ id }})</div>
<div id="book_{{ id }}">{{ entity.title }} (#{{ id }})</div>
</twig:Turbo:Stream:Append>
{% endblock %}

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

Expand Down

0 comments on commit bfdbb46

Please sign in to comment.