Skip to content

Commit b2d42c2

Browse files
committed
minor #1166 Add lowest, Symfony 7.4 and 8.0 tests for bridges (OskarStark)
This PR was merged into the main branch. Discussion ---------- Add lowest, Symfony 7.4 and 8.0 tests for bridges | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | Docs? | no | Issues | -- | License | MIT Dynamically generate matrix includes for both packages and bridges, eliminating hardcoded entries and ensuring new bridges are automatically tested with all PHP/Symfony version combinations. Commits ------- 9a30a5b Add lowest, Symfony 7.4 and 8.0 tests for bridges
2 parents cbda539 + 9a30a5b commit b2d42c2

File tree

1 file changed

+30
-58
lines changed

1 file changed

+30
-58
lines changed

.github/workflows/unit-tests.yaml

Lines changed: 30 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ jobs:
2323
runs-on: ubuntu-latest
2424
outputs:
2525
packages: ${{ steps.set-matrix.outputs.packages }}
26+
packages-include: ${{ steps.set-matrix.outputs.packages-include }}
2627
bridges: ${{ steps.set-matrix.outputs.bridges }}
28+
bridges-include: ${{ steps.set-matrix.outputs.bridges-include }}
2729
steps:
2830
- name: Checkout
2931
uses: actions/checkout@v6
@@ -50,6 +52,19 @@ jobs:
5052
done
5153
echo "packages=$PACKAGES" >> $GITHUB_OUTPUT
5254
55+
# Generate package includes (lowest, Symfony 7.4, Symfony 8.0)
56+
PACKAGES_INCLUDE=$(echo "$PACKAGES" | jq -c '
57+
. as $pkgs |
58+
# lowest deps with PHP 8.2
59+
($pkgs | map(. + {"php-version": "8.2", "dependency-version": "lowest"})) +
60+
# Symfony 7.4 LTS with PHP 8.2
61+
($pkgs | map(. + {"php-version": "8.2", "symfony-version": "7.4.*"})) +
62+
# Symfony 8.0 with PHP 8.5
63+
($pkgs | map(. + {"php-version": "8.5", "symfony-version": "8.0.*"}))
64+
| map({package: {path: .path, type: .type, name: .name}} + (. | del(.path, .type, .name)))
65+
')
66+
echo "packages-include=$PACKAGES_INCLUDE" >> $GITHUB_OUTPUT
67+
5368
# Bridges (store and tool)
5469
STORE_BRIDGES=$(ls -1 src/store/src/Bridge/ | sort \
5570
| jq -R -s -c 'split("\n") | map(select(length > 0)) | map({component: "store", type: "Store", bridge: .})')
@@ -58,6 +73,19 @@ jobs:
5873
BRIDGES=$(jq -n -c --argjson store "$STORE_BRIDGES" --argjson tool "$TOOL_BRIDGES" '$store + $tool')
5974
echo "bridges=$BRIDGES" >> $GITHUB_OUTPUT
6075
76+
# Generate bridge includes (lowest, Symfony 7.4, Symfony 8.0)
77+
BRIDGES_INCLUDE=$(echo "$BRIDGES" | jq -c '
78+
. as $bridges |
79+
# lowest deps with PHP 8.2
80+
($bridges | map(. + {"php-version": "8.2", "dependency-version": "lowest"})) +
81+
# Symfony 7.4 LTS with PHP 8.2
82+
($bridges | map(. + {"php-version": "8.2", "symfony-version": "7.4.*"})) +
83+
# Symfony 8.0 with PHP 8.5
84+
($bridges | map(. + {"php-version": "8.5", "symfony-version": "8.0.*"}))
85+
| map({bridge: {component: .component, type: .type, bridge: .bridge}} + (. | del(.component, .type, .bridge)))
86+
')
87+
echo "bridges-include=$BRIDGES_INCLUDE" >> $GITHUB_OUTPUT
88+
6189
# Pretty print for info
6290
echo "### Packages"
6391
echo "$PACKAGES" | jq .
@@ -76,64 +104,7 @@ jobs:
76104
php-version: ['8.2', '8.5']
77105
dependency-version: ['']
78106
symfony-version: ['']
79-
include:
80-
# lowest deps for all packages
81-
- php-version: '8.2'
82-
dependency-version: 'lowest'
83-
package: { path: 'agent', type: 'Component', name: 'Agent' }
84-
- php-version: '8.2'
85-
dependency-version: 'lowest'
86-
package: { path: 'ai-bundle', type: 'Bundle', name: 'AI Bundle' }
87-
- php-version: '8.2'
88-
dependency-version: 'lowest'
89-
package: { path: 'chat', type: 'Component', name: 'Chat' }
90-
- php-version: '8.2'
91-
dependency-version: 'lowest'
92-
package: { path: 'mcp-bundle', type: 'Bundle', name: 'MCP Bundle' }
93-
- php-version: '8.2'
94-
dependency-version: 'lowest'
95-
package: { path: 'platform', type: 'Component', name: 'Platform' }
96-
- php-version: '8.2'
97-
dependency-version: 'lowest'
98-
package: { path: 'store', type: 'Component', name: 'Store' }
99-
# Symfony 7.4 LTS for all packages
100-
- php-version: '8.2'
101-
symfony-version: '7.4.*'
102-
package: { path: 'agent', type: 'Component', name: 'Agent' }
103-
- php-version: '8.2'
104-
symfony-version: '7.4.*'
105-
package: { path: 'ai-bundle', type: 'Bundle', name: 'AI Bundle' }
106-
- php-version: '8.2'
107-
symfony-version: '7.4.*'
108-
package: { path: 'chat', type: 'Component', name: 'Chat' }
109-
- php-version: '8.2'
110-
symfony-version: '7.4.*'
111-
package: { path: 'mcp-bundle', type: 'Bundle', name: 'MCP Bundle' }
112-
- php-version: '8.2'
113-
symfony-version: '7.4.*'
114-
package: { path: 'platform', type: 'Component', name: 'Platform' }
115-
- php-version: '8.2'
116-
symfony-version: '7.4.*'
117-
package: { path: 'store', type: 'Component', name: 'Store' }
118-
# Symfony 8.0 for all packages
119-
- php-version: '8.5'
120-
symfony-version: '8.0.*'
121-
package: { path: 'agent', type: 'Component', name: 'Agent' }
122-
- php-version: '8.5'
123-
symfony-version: '8.0.*'
124-
package: { path: 'ai-bundle', type: 'Bundle', name: 'AI Bundle' }
125-
- php-version: '8.5'
126-
symfony-version: '8.0.*'
127-
package: { path: 'chat', type: 'Component', name: 'Chat' }
128-
- php-version: '8.5'
129-
symfony-version: '8.0.*'
130-
package: { path: 'mcp-bundle', type: 'Bundle', name: 'MCP Bundle' }
131-
- php-version: '8.5'
132-
symfony-version: '8.0.*'
133-
package: { path: 'platform', type: 'Component', name: 'Platform' }
134-
- php-version: '8.5'
135-
symfony-version: '8.0.*'
136-
package: { path: 'store', type: 'Component', name: 'Store' }
107+
include: ${{ fromJson(needs.matrix.outputs.packages-include) }}
137108

138109
env:
139110
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=7.4' }}
@@ -174,6 +145,7 @@ jobs:
174145
php-version: ['8.2', '8.5']
175146
dependency-version: ['']
176147
symfony-version: ['']
148+
include: ${{ fromJson(needs.matrix.outputs.bridges-include) }}
177149

178150
env:
179151
SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=7.4' }}

0 commit comments

Comments
 (0)