diff --git a/.github/workflows/backend-ci.yaml b/.github/workflows/backend-ci.yaml index f7bc485..eed78e6 100644 --- a/.github/workflows/backend-ci.yaml +++ b/.github/workflows/backend-ci.yaml @@ -10,13 +10,13 @@ on: jobs: cs-fix: name: Run code style check - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-26.04" strategy: matrix: php: - - '8.3' + - '8.4' steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - uses: ibexa/gh-workflows/actions/composer-install@main with: @@ -27,21 +27,44 @@ jobs: - name: Run code style check run: composer run-script check-cs -- --format=checkstyle | cs2pr + env: + PHP_CS_FIXER_IGNORE_ENV: 1 + + deptrac: + name: Deptrac + runs-on: "ubuntu-26.04" + strategy: + fail-fast: false + matrix: + php: + - '8.4' + steps: + - uses: actions/checkout@v7 + + - name: Install Composer dependencies + 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-22.04" + runs-on: "ubuntu-26.04" timeout-minutes: 10 strategy: fail-fast: false matrix: php: - - '8.3' - '8.4' steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Setup PHP Action uses: shivammathur/setup-php@v2 @@ -80,17 +103,16 @@ jobs: --health-timeout 5s --health-retries 5 --tmpfs /var/lib/postgresql/data - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-26.04" timeout-minutes: 20 strategy: matrix: php: - - '8.3' - '8.4' steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Setup PHP Action uses: shivammathur/setup-php@v2 @@ -132,17 +154,16 @@ jobs: --health-timeout=5s --health-retries=5 --tmpfs=/var/lib/mysql - runs-on: "ubuntu-22.04" + runs-on: "ubuntu-26.04" timeout-minutes: 20 strategy: matrix: php: - - '8.3' - '8.4' steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v7 - name: Setup PHP Action uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/frontend-ci.yaml b/.github/workflows/frontend-ci.yaml index cdfc5c9..9dc0a94 100644 --- a/.github/workflows/frontend-ci.yaml +++ b/.github/workflows/frontend-ci.yaml @@ -14,11 +14,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@v5 + - uses: actions/checkout@v7 - uses: actions/setup-node@v4 with: node-version: '18' diff --git a/.github/workflows/rector.yaml b/.github/workflows/rector.yaml index dd5ea18..98a3230 100644 --- a/.github/workflows/rector.yaml +++ b/.github/workflows/rector.yaml @@ -10,13 +10,13 @@ on: 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@v5 + - uses: actions/checkout@v7 - uses: ibexa/gh-workflows/actions/composer-install@main with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1503cbe..dc27adb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -8,7 +8,7 @@ on: jobs: release: - runs-on: ubuntu-latest + runs-on: ubuntu-26.04 steps: - uses: actions/checkout@master diff --git a/.gitignore b/.gitignore index 4d90817..0faeeee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.deptrac.cache /.php-cs-fixer.cache /.phpunit.result.cache /composer.lock diff --git a/composer.json b/composer.json index 20bce1a..d95c1bb 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ }, "require-dev": { "dama/doctrine-test-bundle": "^8.2", + "deptrac/deptrac": "^4.7", "ibexa/code-style": "~2.0.0", "ibexa/rector": "~6.0.x-dev", "ibexa/test-core": "~6.0.x-dev", @@ -30,7 +31,8 @@ "psr-4": { "Ibexa\\Bundle\\CorePersistence\\": "src/bundle/", "Ibexa\\Contracts\\CorePersistence\\": "src/contracts/", - "Ibexa\\CorePersistence\\": "src/lib/" + "Ibexa\\CorePersistence\\": "src/lib/", + "Ibexa\\InternalContracts\\CorePersistence\\": "src/internal-contracts/" } }, "autoload-dev": { @@ -45,13 +47,15 @@ "check-cs": "@fix-cs --dry-run", "test": "phpunit -c phpunit.xml.dist", "test-integration": "phpunit -c phpunit.integration.xml", - "phpstan": "phpstan analyse -c phpstan.neon" + "phpstan": "phpstan analyse -c phpstan.neon", + "deptrac": "php vendor/bin/deptrac analyse" }, "scripts-descriptions": { "fix-cs": "Automatically fixes code style in all files", "check-cs": "Run code style checker for all files", "test": "Run automatic tests", - "phpstan": "Run static code analysis" + "phpstan": "Run static code analysis", + "deptrac": "Run Deptrac architecture testing" }, "extra": { "branch-alias": { diff --git a/deptrac.baseline.yaml b/deptrac.baseline.yaml new file mode 100644 index 0000000..6d183c5 --- /dev/null +++ b/deptrac.baseline.yaml @@ -0,0 +1,8 @@ +deptrac: + skip_violations: + Ibexa\Contracts\CorePersistence\Gateway\AbstractDoctrineDatabase: + - Ibexa\CorePersistence\Gateway\ExpressionVisitor + - Ibexa\CorePersistence\Gateway\RelationshipTypeStrategyRegistry + Ibexa\Contracts\CorePersistence\Gateway\AbstractTranslationGateway: + - Ibexa\CorePersistence\Gateway\ExpressionVisitor + - Ibexa\CorePersistence\Gateway\RelationshipTypeStrategyRegistry diff --git a/deptrac.yaml b/deptrac.yaml index 174c771..75bc12d 100644 --- a/deptrac.yaml +++ b/deptrac.yaml @@ -1,26 +1,37 @@ +imports: + - deptrac.baseline.yaml + deptrac: paths: - ./src + - ./tests layers: - name: Bundle collectors: - type: directory - value: bundle/.* + value: src/bundle/.* + - type: directory + value: src/lib/.* - name: Contracts collectors: - type: directory - value: contracts/.* - - name: Library + value: src/contracts/.* + - name: InternalContracts + collectors: + - type: directory + value: src/internal-contracts/.* + - name: Test collectors: - type: directory - value: lib/.* + value: tests/.* ruleset: Bundle: - - Bundle - Contracts - - Library - Contracts: + - InternalContracts + Contracts: ~ + InternalContracts: - Contracts - Library: + Test: + - Bundle - Contracts - - Library + - InternalContracts diff --git a/src/internal-contracts/.gitkeep b/src/internal-contracts/.gitkeep new file mode 100644 index 0000000..e69de29