Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 8 additions & 27 deletions .github/workflows/backend-ci.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: CI
name: Backend CI

on:
push:
branches:
- '[0-9]+.[0-9]+'
pull_request: ~
workflow_dispatch: ~

jobs:
cs-fix:
Expand All @@ -19,38 +20,17 @@ jobs:

- uses: ibexa/gh-workflows/actions/composer-install@main
with:
php-version: ${{ matrix.php }}
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
satis-network-token: ${{ secrets.SATIS_NETWORK_TOKEN }}

- name: Run code style check
run: composer run-script check-cs -- --format=checkstyle | cs2pr

rector:
name: Run rector
runs-on: "ubuntu-24.04"
strategy:
matrix:
php:
- '8.3'
steps:
- uses: actions/checkout@v6

- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
extensions: 'pdo_sqlite, gd'
tools: cs2pr

- uses: ramsey/composer-install@v3
with:
dependency-versions: highest

- name: Run rector
run: vendor/bin/rector process --dry-run --ansi
shell: bash
run: |
set -euo pipefail
composer run-script check-cs -- --format=checkstyle | cs2pr

tests:
name: Unit tests & SQLite integration tests
Expand All @@ -69,6 +49,7 @@ jobs:

- uses: ibexa/gh-workflows/actions/composer-install@main
with:
php-version: ${{ matrix.php }}
gh-client-id: ${{ secrets.AUTOMATION_CLIENT_ID }}
gh-client-secret: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
satis-network-key: ${{ secrets.SATIS_NETWORK_KEY }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/browser-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Browser tests
on:
push:
branches:
- main
- '[0-9]+.[0-9]+'
pull_request: ~

Expand Down
10 changes: 0 additions & 10 deletions .github/workflows/pr-assign.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions .github/workflows/rector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Rector PHP
on:
push:
branches:
- '[0-9]+.[0-9]+'
pull_request: ~
jobs:
rector:
name: Run rector
uses: ibexa/gh-workflows/.github/workflows/rector.yml@main
with:
php-version: '8.3'
secrets:
AUTOMATION_CLIENT_ID: ${{ secrets.AUTOMATION_CLIENT_ID }}
AUTOMATION_CLIENT_SECRET: ${{ secrets.AUTOMATION_CLIENT_SECRET }}
SATIS_NETWORK_KEY: ${{ secrets.SATIS_NETWORK_KEY }}
SATIS_NETWORK_TOKEN: ${{ secrets.SATIS_NETWORK_TOKEN }}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"ibexa/rector": "~5.0.x-dev",
"ibexa/rest": "~5.0.x-dev",
"ibexa/search": "~5.0.x-dev",
"ibexa/test-core": "~5.0.x-dev",
"matthiasnoback/symfony-dependency-injection-test": "^5.0",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
Expand Down
29 changes: 2 additions & 27 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,10 @@
*/
declare(strict_types=1);

use Ibexa\Contracts\Core\Test\Persistence\Fixture\FixtureImporter;
use Ibexa\Tests\Core\Repository\LegacySchemaImporter;
use Ibexa\Tests\Integration\User\IbexaTestKernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Console\Input\ArrayInput;
use Ibexa\Contracts\Test\Core\Bootstrapper\Bootstrapper;

require dirname(__DIR__) . '/vendor/autoload.php';

chdir(__DIR__ . '/..');

$kernel = new IbexaTestKernel('test', true);
$kernel->boot();

$application = new Application($kernel);
$application->setAutoExit(false);

$application->run(new ArrayInput([
'command' => 'doctrine:database:create',
]));

/** @var \Psr\Container\ContainerInterface $testContainer */
$testContainer = $kernel->getContainer()->get('test.service_container');

$schemaImporter = $testContainer->get(LegacySchemaImporter::class);
foreach ($kernel->getSchemaFiles() as $file) {
$schemaImporter->importSchema($file);
}

$fixtureImporter = $testContainer->get(FixtureImporter::class);
foreach ($kernel->getFixtures() as $fixture) {
$fixtureImporter->import($fixture);
}
(new Bootstrapper())->bootstrap();
15 changes: 4 additions & 11 deletions tests/integration/IbexaTestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@

use Ibexa\Bundle\ContentForms\IbexaContentFormsBundle;
use Ibexa\Bundle\Notifications\IbexaNotificationsBundle;
use Ibexa\Bundle\Test\Core\IbexaTestCoreBundle;
use Ibexa\Bundle\User\IbexaUserBundle;
use Ibexa\ContentForms\Form\ActionDispatcher\UserDispatcher;
use Ibexa\Contracts\Core\Test\IbexaTestKernel as BaseIbexaTestKernel;
use Ibexa\Contracts\Test\Core\IbexaTestKernel as BaseIbexaTestKernel;
use Ibexa\Contracts\User\Invitation\InvitationService;
use LogicException;
use Symfony\Component\Config\Loader\LoaderInterface;
Expand All @@ -22,21 +23,13 @@

final class IbexaTestKernel extends BaseIbexaTestKernel
{
#[\Override]
public function getSchemaFiles(): iterable
{
yield from parent::getSchemaFiles();

yield from [
$this->locateResource('@IbexaUserBundle/Resources/config/storage/schema.yaml'),
];
}

#[\Override]
public function registerBundles(): iterable
{
yield from parent::registerBundles();

yield new IbexaTestCoreBundle();

yield from [
new IbexaUserBundle(),
new IbexaNotificationsBundle(),
Expand Down