|
24 | 24 | outputs: |
25 | 25 | packages: ${{ steps.set-matrix.outputs.packages }} |
26 | 26 | packages-include: ${{ steps.set-matrix.outputs.packages-include }} |
27 | | - bridges: ${{ steps.set-matrix.outputs.bridges }} |
28 | | - bridges-include: ${{ steps.set-matrix.outputs.bridges-include }} |
| 27 | + store-bridges: ${{ steps.set-matrix.outputs.store-bridges }} |
| 28 | + store-bridges-include: ${{ steps.set-matrix.outputs.store-bridges-include }} |
| 29 | + tool-bridges: ${{ steps.set-matrix.outputs.tool-bridges }} |
| 30 | + tool-bridges-include: ${{ steps.set-matrix.outputs.tool-bridges-include }} |
29 | 31 | steps: |
30 | 32 | - name: Checkout |
31 | 33 | uses: actions/checkout@v6 |
@@ -65,33 +67,52 @@ jobs: |
65 | 67 | ') |
66 | 68 | echo "packages-include=$PACKAGES_INCLUDE" >> $GITHUB_OUTPUT |
67 | 69 |
|
68 | | - # Bridges (store and tool) |
| 70 | + # Store Bridges |
69 | 71 | STORE_BRIDGES=$(ls -1 src/store/src/Bridge/ | sort \ |
70 | | - | jq -R -s -c 'split("\n") | map(select(length > 0)) | map({component: "store", type: "Store", bridge: .})') |
| 72 | + | jq -R -s -c 'split("\n") | map(select(length > 0)) | map({component: "store", bridge: .})') |
| 73 | + echo "store-bridges=$STORE_BRIDGES" >> $GITHUB_OUTPUT |
| 74 | +
|
| 75 | + # Generate store bridge includes (lowest, Symfony 7.4, Symfony 8.0) |
| 76 | + STORE_BRIDGES_INCLUDE=$(echo "$STORE_BRIDGES" | jq -c ' |
| 77 | + . as $bridges | |
| 78 | + # lowest deps with PHP 8.2 |
| 79 | + ($bridges | map(. + {"php-version": "8.2", "dependency-version": "lowest"})) + |
| 80 | + # Symfony 7.4 LTS with PHP 8.2 |
| 81 | + ($bridges | map(. + {"php-version": "8.2", "symfony-version": "7.4.*"})) + |
| 82 | + # Symfony 8.0 with PHP 8.5 |
| 83 | + ($bridges | map(. + {"php-version": "8.5", "symfony-version": "8.0.*"})) |
| 84 | + | map({bridge: {component: .component, bridge: .bridge}} + (. | del(.component, .bridge))) |
| 85 | + ') |
| 86 | + echo "store-bridges-include=$STORE_BRIDGES_INCLUDE" >> $GITHUB_OUTPUT |
| 87 | +
|
| 88 | + # Tool Bridges |
71 | 89 | TOOL_BRIDGES=$(ls -1 src/agent/src/Bridge/ | sort \ |
72 | | - | jq -R -s -c 'split("\n") | map(select(length > 0)) | map({component: "agent", type: "Tool", bridge: .})') |
73 | | - BRIDGES=$(jq -n -c --argjson store "$STORE_BRIDGES" --argjson tool "$TOOL_BRIDGES" '$store + $tool') |
74 | | - echo "bridges=$BRIDGES" >> $GITHUB_OUTPUT |
| 90 | + | jq -R -s -c 'split("\n") | map(select(length > 0)) | map({component: "agent", bridge: .})') |
| 91 | + echo "tool-bridges=$TOOL_BRIDGES" >> $GITHUB_OUTPUT |
75 | 92 |
|
76 | | - # Generate bridge includes (lowest, Symfony 7.4, Symfony 8.0) |
77 | | - BRIDGES_INCLUDE=$(echo "$BRIDGES" | jq -c ' |
| 93 | + # Generate tool bridge includes (lowest, Symfony 7.4, Symfony 8.0) |
| 94 | + TOOL_BRIDGES_INCLUDE=$(echo "$TOOL_BRIDGES" | jq -c ' |
78 | 95 | . as $bridges | |
79 | 96 | # lowest deps with PHP 8.2 |
80 | 97 | ($bridges | map(. + {"php-version": "8.2", "dependency-version": "lowest"})) + |
81 | 98 | # Symfony 7.4 LTS with PHP 8.2 |
82 | 99 | ($bridges | map(. + {"php-version": "8.2", "symfony-version": "7.4.*"})) + |
83 | 100 | # Symfony 8.0 with PHP 8.5 |
84 | 101 | ($bridges | map(. + {"php-version": "8.5", "symfony-version": "8.0.*"})) |
85 | | - | map({bridge: {component: .component, type: .type, bridge: .bridge}} + (. | del(.component, .type, .bridge))) |
| 102 | + | map({bridge: {component: .component, bridge: .bridge}} + (. | del(.component, .bridge))) |
86 | 103 | ') |
87 | | - echo "bridges-include=$BRIDGES_INCLUDE" >> $GITHUB_OUTPUT |
| 104 | + echo "tool-bridges-include=$TOOL_BRIDGES_INCLUDE" >> $GITHUB_OUTPUT |
88 | 105 |
|
89 | 106 | # Pretty print for info |
90 | | - echo "### Packages" |
| 107 | + echo "::group::Packages" |
91 | 108 | echo "$PACKAGES" | jq . |
92 | | - echo "" |
93 | | - echo "### Bridges" |
94 | | - echo "$BRIDGES" | jq . |
| 109 | + echo "::endgroup::" |
| 110 | + echo "::group::Store Bridges" |
| 111 | + echo "$STORE_BRIDGES" | jq . |
| 112 | + echo "::endgroup::" |
| 113 | + echo "::group::Tool Bridges" |
| 114 | + echo "$TOOL_BRIDGES" | jq . |
| 115 | + echo "::endgroup::" |
95 | 116 |
|
96 | 117 | package: |
97 | 118 | name: ${{ matrix.package.type }} / ${{ matrix.package.name }} / PHP ${{ matrix.php-version }}${{ matrix.dependency-version == 'lowest' && ' / lowest' || '' }}${{ matrix.symfony-version && format(' / Symfony {0}', matrix.symfony-version) || '' }} |
@@ -134,18 +155,59 @@ jobs: |
134 | 155 | - name: Run PHPUnit |
135 | 156 | run: cd src/${{ matrix.package.path }} && vendor/bin/phpunit |
136 | 157 |
|
137 | | - bridge: |
138 | | - name: ${{ matrix.bridge.type }} / ${{ matrix.bridge.bridge }} / PHP ${{ matrix.php-version }}${{ matrix.dependency-version == 'lowest' && ' / lowest' || '' }}${{ matrix.symfony-version && format(' / Symfony {0}', matrix.symfony-version) || '' }} |
| 158 | + store-bridge: |
| 159 | + name: Store / ${{ matrix.bridge.bridge }} / PHP ${{ matrix.php-version }}${{ matrix.dependency-version == 'lowest' && ' / lowest' || '' }}${{ matrix.symfony-version && format(' / Symfony {0}', matrix.symfony-version) || '' }} |
| 160 | + needs: matrix |
| 161 | + runs-on: ubuntu-latest |
| 162 | + strategy: |
| 163 | + fail-fast: false |
| 164 | + matrix: |
| 165 | + bridge: ${{ fromJson(needs.matrix.outputs.store-bridges) }} |
| 166 | + php-version: ['8.2', '8.5'] |
| 167 | + dependency-version: [''] |
| 168 | + symfony-version: [''] |
| 169 | + include: ${{ fromJson(needs.matrix.outputs.store-bridges-include) }} |
| 170 | + |
| 171 | + env: |
| 172 | + SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=7.4' }} |
| 173 | + |
| 174 | + steps: |
| 175 | + - name: Checkout |
| 176 | + uses: actions/checkout@v6 |
| 177 | + |
| 178 | + - name: Configure environment |
| 179 | + run: | |
| 180 | + echo COLUMNS=120 >> $GITHUB_ENV |
| 181 | + [ 'lowest' = '${{ matrix.dependency-version }}' ] && echo SYMFONY_DEPRECATIONS_HELPER=weak >> $GITHUB_ENV || true |
| 182 | +
|
| 183 | + - name: Setup PHP |
| 184 | + uses: shivammathur/setup-php@v2 |
| 185 | + with: |
| 186 | + php-version: ${{ matrix.php-version }} |
| 187 | + tools: flex |
| 188 | + extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }} |
| 189 | + |
| 190 | + - name: Install dependencies |
| 191 | + uses: ramsey/composer-install@v3 |
| 192 | + with: |
| 193 | + working-directory: src/${{ matrix.bridge.component }}/src/Bridge/${{ matrix.bridge.bridge }} |
| 194 | + dependency-versions: ${{ matrix.dependency-version || 'highest' }} |
| 195 | + |
| 196 | + - name: Run PHPUnit |
| 197 | + run: cd src/${{ matrix.bridge.component }}/src/Bridge/${{ matrix.bridge.bridge }} && vendor/bin/phpunit |
| 198 | + |
| 199 | + tool-bridge: |
| 200 | + name: Tool / ${{ matrix.bridge.bridge }} / PHP ${{ matrix.php-version }}${{ matrix.dependency-version == 'lowest' && ' / lowest' || '' }}${{ matrix.symfony-version && format(' / Symfony {0}', matrix.symfony-version) || '' }} |
139 | 201 | needs: matrix |
140 | 202 | runs-on: ubuntu-latest |
141 | 203 | strategy: |
142 | 204 | fail-fast: false |
143 | 205 | matrix: |
144 | | - bridge: ${{ fromJson(needs.matrix.outputs.bridges) }} |
| 206 | + bridge: ${{ fromJson(needs.matrix.outputs.tool-bridges) }} |
145 | 207 | php-version: ['8.2', '8.5'] |
146 | 208 | dependency-version: [''] |
147 | 209 | symfony-version: [''] |
148 | | - include: ${{ fromJson(needs.matrix.outputs.bridges-include) }} |
| 210 | + include: ${{ fromJson(needs.matrix.outputs.tool-bridges-include) }} |
149 | 211 |
|
150 | 212 | env: |
151 | 213 | SYMFONY_REQUIRE: ${{ matrix.symfony-version || '>=7.4' }} |
|
0 commit comments