Skip to content

Commit 37e55d0

Browse files
committed
Use deptrac to ensure component dependencies
1 parent 9940d5c commit 37e55d0

File tree

5 files changed

+104
-0
lines changed

5 files changed

+104
-0
lines changed

.github/workflows/deptrac.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: deptrac
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'src/*/doc/**'
7+
- 'src/**/*.md'
8+
pull_request:
9+
paths-ignore:
10+
- 'src/*/doc/**'
11+
- 'src/**/*.md'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
deptrac:
19+
name: deptrac
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v5
24+
25+
- name: Configure environment
26+
run: |
27+
echo COLUMNS=120 >> $GITHUB_ENV
28+
echo COMPOSER_UP='composer update --prefer-lowest --no-progress --no-interaction --ansi --ignore-platform-req=ext-mongodb' >> $GITHUB_ENV
29+
30+
- name: Setup PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: '8.4'
34+
35+
- name: Get composer cache directory
36+
id: composer-cache
37+
run: |
38+
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
39+
40+
- name: Cache packages dependencies
41+
uses: actions/cache@v4
42+
with:
43+
path: ${{ steps.composer-cache.outputs.dir }}
44+
key: ${{ runner.os }}-composer-packages-${{ hashFiles('src/**/composer.json') }}
45+
restore-keys: |
46+
${{ runner.os }}-composer-packages
47+
48+
- name: Install root dependencies
49+
uses: ramsey/composer-install@v3
50+
51+
- name: Build root packages
52+
run: php .github/build-packages.php
53+
54+
- name: Run deptrac/deptrac
55+
run: $COMPOSER_UP && vendor/bin/deptrac

.github/workflows/unit-tests.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ jobs:
7474
restore-keys: |
7575
${{ runner.os }}-composer-packages-${{ matrix.php-version }}-${{ matrix.dependency-version }}-${{ matrix.symfony-version }}
7676
77+
- name: Remove deptrac/deptrac for Symfony 8
78+
if: matrix.symfony-version == '8.0.*'
79+
run: composer remove deptrac/deptrac --dev --no-update
80+
7781
- name: Install root dependencies
7882
uses: ramsey/composer-install@v3
7983

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.deptrac.cache
12
.doctor-rst.cache
23
.php-cs-fixer.cache
34
.phpunit.cache

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
],
88
"require-dev": {
99
"php": ">=8.2",
10+
"deptrac/deptrac": "^4.2",
1011
"php-cs-fixer/shim": "^3.75",
1112
"phpstan/phpstan-strict-rules": "^2.0",
1213
"symfony/filesystem": "^7.3|^8.0",

deptrac.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
deptrac:
2+
paths:
3+
- ./src
4+
exclude_files:
5+
- '#.*test.*#'
6+
- '#.*vendor.*#'
7+
layers:
8+
- name: Agent
9+
collectors:
10+
- type: classLike
11+
value: Symfony\\AI\\Agent.*
12+
- name: Chat
13+
collectors:
14+
- type: classLike
15+
value: Symfony\\AI\\Chat.*
16+
- name: Platform
17+
collectors:
18+
- type: classLike
19+
value: Symfony\\AI\\Platform.*
20+
- name: Store
21+
collectors:
22+
- type: classLike
23+
value: Symfony\\AI\\Store.*
24+
ruleset:
25+
Agent:
26+
- Platform
27+
- Store
28+
Chat:
29+
- Agent
30+
- Platform
31+
Platform: ~
32+
Store:
33+
- Platform
34+
# Baseline of known violations to be skipped for now
35+
skip_violations:
36+
Symfony\AI\Platform\Bridge\Anthropic\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
37+
Symfony\AI\Platform\Bridge\DeepSeek\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
38+
Symfony\AI\Platform\Bridge\Gemini\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
39+
Symfony\AI\Platform\Bridge\Mistral\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
40+
Symfony\AI\Platform\Bridge\OpenAi\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
41+
Symfony\AI\Platform\Bridge\Perplexity\SearchResultProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
42+
Symfony\AI\Platform\Bridge\Perplexity\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]
43+
Symfony\AI\Platform\Bridge\VertexAi\TokenOutputProcessor: [Symfony\AI\Agent\OutputProcessorInterface, Symfony\AI\Agent\Output]

0 commit comments

Comments
 (0)