diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index 2c0af0183..55881998a 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -17,13 +17,13 @@ on: jobs: cs-fix: name: Run code style check - runs-on: "ubuntu-24.04" + runs-on: "ubuntu-26.04" strategy: matrix: php: - '8.3' steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: ibexa/gh-workflows/actions/setup-composer-root-version@main @@ -39,13 +39,13 @@ jobs: rector: name: Run rector - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-26.04" strategy: matrix: php: - - '8.3' + - '8.4' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Setup PHP Action uses: shivammathur/setup-php@v2 @@ -55,7 +55,7 @@ jobs: extensions: 'pdo_sqlite, gd' tools: cs2pr - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: ibexa/gh-workflows/actions/composer-install@main with: @@ -67,20 +67,40 @@ jobs: - name: Run rector run: vendor/bin/rector process --dry-run --ansi + deptrac: + name: Deptrac + runs-on: "ubuntu-26.04" + strategy: + fail-fast: false + matrix: + php: + - '8.4' + steps: + - uses: actions/checkout@v7 + + - uses: ibexa/gh-workflows/actions/composer-install@main + with: + 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 deptrac + run: composer run-script deptrac + tests: name: Tests - runs-on: "ubuntu-24.04" + runs-on: "ubuntu-26.04" timeout-minutes: 10 strategy: fail-fast: false matrix: php: - - '8.3' - '8.4' steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: ibexa/gh-workflows/actions/setup-composer-root-version@main @@ -119,17 +139,16 @@ jobs: --health-timeout 5s --health-retries 5 --tmpfs /var/lib/postgresql/data - runs-on: "ubuntu-24.04" + runs-on: "ubuntu-26.04" timeout-minutes: 20 strategy: matrix: php: - - '8.3' - '8.4' steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: ibexa/gh-workflows/actions/setup-composer-root-version@main @@ -171,18 +190,17 @@ jobs: --health-timeout=5s --health-retries=5 --tmpfs=/var/lib/mysql - runs-on: "ubuntu-24.04" + runs-on: "ubuntu-26.04" timeout-minutes: 20 strategy: fail-fast: false matrix: php: - - '8.3' - '8.4' steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - uses: ibexa/gh-workflows/actions/setup-composer-root-version@main @@ -208,7 +226,7 @@ jobs: name: Notify Slack needs: [cs-fix, tests, integration-tests-postgres, integration-tests-mysql] if: always() && github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - name: Determine overall result id: result diff --git a/.github/workflows/frontend-ci.yaml b/.github/workflows/frontend-ci.yaml index e2af25a3f..30455c8a9 100644 --- a/.github/workflows/frontend-ci.yaml +++ b/.github/workflows/frontend-ci.yaml @@ -26,11 +26,11 @@ on: jobs: frontend-test: name: Frontend build test - runs-on: 'ubuntu-24.04' + runs-on: 'ubuntu-26.04' timeout-minutes: 5 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: actions/setup-node@v4 with: node-version: '20' diff --git a/.gitignore b/.gitignore index 7026e200f..ae2b60b4e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ yarn-error.log /vendor /.php_cs.cache /.php-cs-fixer.cache +/.deptrac.cache package-lock.json .DS_Store .phpunit.result.cache diff --git a/composer.json b/composer.json index 6e647b801..ab0f7ce16 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,8 @@ "psr-4": { "Ibexa\\AdminUi\\": "src/lib/", "Ibexa\\Bundle\\AdminUi\\": "src/bundle/", - "Ibexa\\Contracts\\AdminUi\\": "src/contracts/" + "Ibexa\\Contracts\\AdminUi\\": "src/contracts/", + "Ibexa\\InternalContracts\\AdminUi\\": "src/internal-contracts/" } }, "autoload-dev": { @@ -62,6 +63,7 @@ "require-dev": { "ext-zip": "*", "dama/doctrine-test-bundle": "^8.2", + "deptrac/deptrac": "^4.7", "ibexa/behat": "~6.0.x-dev", "ibexa/code-style": "~2.0.0", "ibexa/doctrine-schema": "~6.0.x-dev", @@ -87,6 +89,7 @@ "scripts": { "fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots", "check-cs": "@fix-cs --dry-run", + "deptrac": "php vendor/bin/deptrac analyse", "phpstan": "phpstan analyse", "test-unit": "phpunit -c phpunit.xml", "test-integration": "phpunit -c phpunit.integration.xml", @@ -95,6 +98,9 @@ "@test-integration" ] }, + "scripts-descriptions": { + "deptrac": "Run Deptrac architecture testing" + }, "extra": { "branch-alias": { "dev-main": "6.0.x-dev" diff --git a/deptrac.baseline.yaml b/deptrac.baseline.yaml new file mode 100644 index 000000000..2c45c1317 --- /dev/null +++ b/deptrac.baseline.yaml @@ -0,0 +1,28 @@ +deptrac: + skip_violations: + Ibexa\Contracts\AdminUi\ContentType\ContentTypeFieldsByExpressionServiceInterface: + - Ibexa\AdminUi\Exception\FieldTypeExpressionParserException + Ibexa\Contracts\AdminUi\Event\ContentProxyCreateEvent: + - Ibexa\AdminUi\Event\Options + Ibexa\Contracts\AdminUi\Event\ContentProxyTranslateEvent: + - Ibexa\AdminUi\Event\Options + Ibexa\Contracts\AdminUi\Event\FieldDefinitionMappingEvent: + - Ibexa\AdminUi\Form\Data\FieldDefinitionData + Ibexa\Contracts\AdminUi\Menu\AbstractActionBuilder: + - Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent + - Ibexa\AdminUi\Specification\ContentIsUser + Ibexa\Contracts\AdminUi\Menu\AbstractBuilder: + - Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent + Ibexa\Contracts\AdminUi\Menu\AbstractFormContextMenuBuilder: + - Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent + Ibexa\Contracts\AdminUi\Menu\CopyFormContextMenuBuilder: + - Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent + Ibexa\Contracts\AdminUi\Menu\CreateFormContextMenuBuilder: + - Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent + Ibexa\Contracts\AdminUi\Menu\UpdateFormContextMenuBuilder: + - Ibexa\AdminUi\Menu\Event\ConfigureMenuEvent + Ibexa\Contracts\AdminUi\Tab\AbstractEventDispatchingTab: + - Ibexa\AdminUi\Tab\Event\TabEvents + - Ibexa\AdminUi\Tab\Event\TabViewRenderEvent + Ibexa\Contracts\AdminUi\UI\Action\FormUiActionMapperInterface: + - Ibexa\AdminUi\UI\Action\UiActionEvent diff --git a/deptrac.yaml b/deptrac.yaml new file mode 100644 index 000000000..75bc12dc2 --- /dev/null +++ b/deptrac.yaml @@ -0,0 +1,37 @@ +imports: + - deptrac.baseline.yaml + +deptrac: + paths: + - ./src + - ./tests + layers: + - name: Bundle + collectors: + - type: directory + value: src/bundle/.* + - type: directory + value: src/lib/.* + - name: Contracts + collectors: + - type: directory + value: src/contracts/.* + - name: InternalContracts + collectors: + - type: directory + value: src/internal-contracts/.* + - name: Test + collectors: + - type: directory + value: tests/.* + ruleset: + Bundle: + - Contracts + - InternalContracts + Contracts: ~ + InternalContracts: + - Contracts + Test: + - Bundle + - Contracts + - InternalContracts diff --git a/src/internal-contracts/.gitkeep b/src/internal-contracts/.gitkeep new file mode 100644 index 000000000..e69de29bb