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
55 changes: 55 additions & 0 deletions .github/workflows/deptrac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: deptrac

on:
push:
paths-ignore:
- 'src/*/doc/**'
- 'src/**/*.md'
pull_request:
paths-ignore:
- 'src/*/doc/**'
- 'src/**/*.md'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
deptrac:
name: deptrac
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5

- name: Configure environment
run: |
echo COLUMNS=120 >> $GITHUB_ENV
echo COMPOSER_UP='composer update --prefer-lowest --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.5'

- name: Get composer cache directory
id: composer-cache
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache packages dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-packages-${{ hashFiles('src/**/composer.json') }}
restore-keys: |
${{ runner.os }}-composer-packages
- name: Install root dependencies
uses: ramsey/composer-install@v3

- name: Build root packages
run: php .github/build-packages.php

- name: Run deptrac/deptrac
run: $COMPOSER_UP && vendor/bin/deptrac
4 changes: 4 additions & 0 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ jobs:
restore-keys: |
${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}
- name: Remove deptrac/deptrac for Symfony 8
if: matrix.symfony-version == '8.0.*'
run: composer remove deptrac/deptrac --dev --no-update

- name: Install root dependencies
uses: ramsey/composer-install@v3

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.deptrac.cache
.doctor-rst.cache
.php-cs-fixer.cache
.phpunit.cache
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
],
"require-dev": {
"php": ">=8.2",
"deptrac/deptrac": "^4.2",
"php-cs-fixer/shim": "^3.75",
"phpstan/phpstan-strict-rules": "^2.0",
"symfony/filesystem": "^7.3|^8.0",
Expand Down
43 changes: 43 additions & 0 deletions deptrac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
deptrac:
paths:
- ./src
exclude_files:
- '#.*test.*#'
- '#.*vendor.*#'
layers:
- name: Agent
collectors:
- type: classLike
value: Symfony\\AI\\Agent.*
- name: Chat
collectors:
- type: classLike
value: Symfony\\AI\\Chat.*
- name: Platform
collectors:
- type: classLike
value: Symfony\\AI\\Platform.*
- name: Store
collectors:
- type: classLike
value: Symfony\\AI\\Store.*
ruleset:
Agent:
- Platform
- Store
Chat:
- Agent
- Platform
Platform: ~
Store:
- Platform
# Baseline of known violations to be skipped for now
skip_violations:
Symfony\AI\Platform\Bridge\Anthropic\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
Symfony\AI\Platform\Bridge\DeepSeek\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
Symfony\AI\Platform\Bridge\Gemini\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
Symfony\AI\Platform\Bridge\Mistral\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
Symfony\AI\Platform\Bridge\OpenAi\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
Symfony\AI\Platform\Bridge\Perplexity\SearchResultProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
Symfony\AI\Platform\Bridge\Perplexity\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
Symfony\AI\Platform\Bridge\VertexAi\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]