|
1 | 1 | name: "build" |
| 2 | + |
2 | 3 | on: |
3 | 4 | push: |
4 | 5 | branches: |
5 | | - - "master" |
6 | | - paths-ignore: |
7 | | - - "**/*.md" |
8 | | - pull_request: |
9 | | - paths-ignore: |
10 | | - - "**/*.md" |
| 6 | + - "*.x" |
| 7 | + pull_request: ~ |
11 | 8 | workflow_dispatch: ~ |
12 | 9 |
|
13 | | -env: |
14 | | - APP_ENV: "test" |
15 | | - DATABASE_URL: "mysql://root:root@127.0.0.1/sylius?serverVersion=8.0" |
16 | | - PHP_EXTENSIONS: "intl, mbstring" |
17 | | - |
18 | 10 | jobs: |
19 | | - coding-standards: |
20 | | - name: "Coding Standards (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }})" |
21 | | - |
| 11 | + backwards-compatibility: |
22 | 12 | runs-on: "ubuntu-latest" |
23 | | - |
24 | | - strategy: |
25 | | - matrix: |
26 | | - php-version: |
27 | | - - "8.1" # Always use the lowest version of PHP since a higher version could create actual syntax errors in lower versions |
28 | | - |
29 | | - dependencies: |
30 | | - - "highest" |
31 | | - |
| 13 | + if: "github.event_name == 'pull_request'" |
32 | 14 | steps: |
33 | | - - name: "Checkout" |
34 | | - uses: "actions/checkout@v4" |
| 15 | + - uses: "setono/sylius-plugin/backwards-compatibility@v2" |
35 | 16 |
|
36 | | - - name: "Setup PHP, with composer and extensions" |
37 | | - uses: "shivammathur/setup-php@v2" |
38 | | - with: |
39 | | - php-version: "${{ matrix.php-version }}" |
40 | | - extensions: "${{ env.PHP_EXTENSIONS }}" |
41 | | - coverage: "none" |
42 | | - |
43 | | - - name: "Install composer dependencies" |
44 | | - uses: "ramsey/composer-install@v2" |
45 | | - with: |
46 | | - dependency-versions: "${{ matrix.dependencies }}" |
47 | | - |
48 | | - - name: "Validate composer" |
49 | | - run: "composer validate --strict" |
50 | | - |
51 | | - - name: "Check composer normalized" |
52 | | - run: "composer normalize --dry-run" |
53 | | - |
54 | | - - name: "Check style" |
55 | | - run: "composer check-style" |
56 | | - |
57 | | - - name: "Rector" |
58 | | - run: "vendor/bin/rector process --dry-run" |
59 | | - continue-on-error: true |
60 | | - |
61 | | - - name: "Lint yaml files" |
62 | | - run: "(cd tests/Application && bin/console lint:yaml ../../src/Resources)" |
63 | | - |
64 | | - - name: "Lint twig files" |
65 | | - run: "(cd tests/Application && bin/console lint:twig ../../src/Resources)" |
| 17 | + coding-standards: |
| 18 | + runs-on: "ubuntu-latest" |
| 19 | + steps: |
| 20 | + - uses: "setono/sylius-plugin/coding-standards@v2" |
66 | 21 |
|
67 | 22 | dependency-analysis: |
68 | | - name: "Dependency Analysis (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})" |
69 | | - |
70 | 23 | runs-on: "ubuntu-latest" |
71 | | - |
72 | 24 | strategy: |
| 25 | + fail-fast: false |
73 | 26 | matrix: |
74 | | - php-version: |
75 | | - - "8.1" |
76 | | - - "8.2" |
77 | | - |
78 | | - dependencies: |
79 | | - - "lowest" |
80 | | - - "highest" |
81 | | - |
82 | | - symfony: |
83 | | - - "~5.4.0" |
84 | | - - "~6.4.0" |
85 | | - |
| 27 | + php-version: ["8.2", "8.3", "8.4"] |
| 28 | + dependencies: ["lowest", "highest"] |
| 29 | + symfony: ["~6.4.0", "~7.4.0"] |
86 | 30 | steps: |
87 | | - - name: "Checkout" |
88 | | - uses: "actions/checkout@v4" |
89 | | - |
90 | | - - name: "Setup PHP, with composer and extensions" |
91 | | - uses: "shivammathur/setup-php@v2" |
| 31 | + - uses: "setono/sylius-plugin/dependency-analysis@v2" |
92 | 32 | with: |
93 | | - coverage: "none" |
94 | | - extensions: "${{ env.PHP_EXTENSIONS }}" |
95 | 33 | php-version: "${{ matrix.php-version }}" |
96 | | - tools: "composer-require-checker, composer-unused, flex" |
97 | | - |
98 | | - - name: "Remove require-dev section in composer.json" |
99 | | - run: "composer config --unset require-dev" |
100 | | - |
101 | | - - name: "Install composer dependencies" |
102 | | - uses: "ramsey/composer-install@v2" |
103 | | - env: |
104 | | - SYMFONY_REQUIRE: "${{ matrix.symfony }}" |
105 | | - with: |
106 | | - dependency-versions: "${{ matrix.dependencies }}" |
| 34 | + dependencies: "${{ matrix.dependencies }}" |
| 35 | + symfony: "${{ matrix.symfony }}" |
107 | 36 |
|
108 | | - - name: "Run maglnet/composer-require-checker" |
109 | | - run: "composer-require-checker check" |
110 | | - |
111 | | - - name: "Run composer-unused/composer-unused" |
112 | | - run: "composer-unused" |
113 | | - |
114 | 37 | static-code-analysis: |
115 | | - name: "Static Code Analysis (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})" |
116 | | - |
117 | 38 | runs-on: "ubuntu-latest" |
118 | | - |
119 | 39 | strategy: |
| 40 | + fail-fast: false |
120 | 41 | matrix: |
121 | | - php-version: |
122 | | - - "8.1" |
123 | | - - "8.2" |
124 | | - |
125 | | - dependencies: |
126 | | - - "lowest" |
127 | | - - "highest" |
128 | | - |
129 | | - symfony: |
130 | | - - "~5.4.0" |
131 | | - - "~6.4.0" |
132 | | - |
| 42 | + php-version: ["8.2", "8.3", "8.4"] |
| 43 | + dependencies: ["lowest", "highest"] |
| 44 | + symfony: ["~6.4.0", "~7.4.0"] |
133 | 45 | steps: |
134 | | - - name: "Checkout" |
135 | | - uses: "actions/checkout@v4" |
136 | | - |
137 | | - - name: "Setup PHP, with composer and extensions" |
138 | | - uses: "shivammathur/setup-php@v2" |
| 46 | + - uses: "setono/sylius-plugin/static-code-analysis@v2" |
139 | 47 | with: |
140 | | - coverage: "none" |
141 | | - extensions: "${{ env.PHP_EXTENSIONS }}" |
142 | 48 | php-version: "${{ matrix.php-version }}" |
143 | | - tools: "flex" |
144 | | - |
145 | | - - name: "Remove sylius/sylius from composer.json" |
146 | | - run: "composer remove --dev --no-update --no-plugins --no-scripts sylius/sylius" |
147 | | - |
148 | | - - name: "Install composer dependencies" |
149 | | - uses: "ramsey/composer-install@v2" |
150 | | - env: |
151 | | - SYMFONY_REQUIRE: "${{ matrix.symfony }}" |
152 | | - with: |
153 | | - dependency-versions: "${{ matrix.dependencies }}" |
154 | | - |
155 | | - - name: "Static analysis" |
156 | | - run: "vendor/bin/psalm --php-version=${{ matrix.php-version }}" |
| 49 | + dependencies: "${{ matrix.dependencies }}" |
| 50 | + symfony: "${{ matrix.symfony }}" |
157 | 51 |
|
158 | 52 | unit-tests: |
159 | | - name: "Unit tests (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})" |
160 | | - |
161 | 53 | runs-on: "ubuntu-latest" |
162 | | - |
163 | 54 | strategy: |
| 55 | + fail-fast: false |
164 | 56 | matrix: |
165 | | - php-version: |
166 | | - - "8.1" |
167 | | - - "8.2" |
168 | | - |
169 | | - dependencies: |
170 | | - - "lowest" |
171 | | - - "highest" |
172 | | - |
173 | | - symfony: |
174 | | - - "~5.4.0" |
175 | | - - "~6.4.0" |
176 | | - |
| 57 | + php-version: ["8.2", "8.3", "8.4"] |
| 58 | + dependencies: ["lowest", "highest"] |
| 59 | + symfony: ["~6.4.0", "~7.4.0"] |
177 | 60 | steps: |
178 | | - - name: "Checkout" |
179 | | - uses: "actions/checkout@v4" |
180 | | - |
181 | | - - name: "Setup PHP, with composer and extensions" |
182 | | - uses: "shivammathur/setup-php@v2" |
| 61 | + - uses: "setono/sylius-plugin/unit-tests@v2" |
183 | 62 | with: |
184 | | - coverage: "none" |
185 | | - extensions: "${{ env.PHP_EXTENSIONS }}" |
186 | 63 | php-version: "${{ matrix.php-version }}" |
187 | | - tools: "flex" |
188 | | - |
189 | | - - name: "Install composer dependencies" |
190 | | - uses: "ramsey/composer-install@v2" |
191 | | - env: |
192 | | - SYMFONY_REQUIRE: "${{ matrix.symfony }}" |
193 | | - with: |
194 | | - dependency-versions: "${{ matrix.dependencies }}" |
195 | | - |
196 | | - - name: "Run phpunit" |
197 | | - run: "composer phpunit" |
198 | | - |
199 | | - integration-tests: |
200 | | - name: "Integration tests (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})" |
| 64 | + dependencies: "${{ matrix.dependencies }}" |
| 65 | + symfony: "${{ matrix.symfony }}" |
201 | 66 |
|
| 67 | + functional-tests: |
202 | 68 | runs-on: "ubuntu-latest" |
203 | | - |
204 | 69 | strategy: |
| 70 | + fail-fast: false |
205 | 71 | matrix: |
206 | | - php-version: |
207 | | - - "8.1" |
208 | | - - "8.2" |
209 | | - |
210 | | - dependencies: |
211 | | - - "lowest" |
212 | | - - "highest" |
213 | | - |
214 | | - symfony: |
215 | | - - "~5.4.0" |
216 | | - - "~6.4.0" |
217 | | - |
| 72 | + php-version: ["8.2", "8.3", "8.4"] |
| 73 | + dependencies: ["highest"] |
| 74 | + symfony: ["~6.4.0", "~7.4.0"] |
218 | 75 | steps: |
219 | | - - name: "Start MySQL" |
220 | | - run: "sudo /etc/init.d/mysql start" |
221 | | - |
222 | | - - name: "Checkout" |
223 | | - uses: "actions/checkout@v4" |
224 | | - |
225 | | - - name: "Setup PHP, with composer and extensions" |
226 | | - uses: "shivammathur/setup-php@v2" |
| 76 | + - uses: "setono/sylius-plugin/functional-tests@v2" |
227 | 77 | with: |
228 | | - coverage: "none" |
229 | | - extensions: "${{ env.PHP_EXTENSIONS }}" |
230 | 78 | php-version: "${{ matrix.php-version }}" |
231 | | - tools: "flex" |
232 | | - |
233 | | - - name: "Install composer dependencies" |
234 | | - uses: "ramsey/composer-install@v2" |
235 | | - env: |
236 | | - SYMFONY_REQUIRE: "${{ matrix.symfony }}" |
237 | | - with: |
238 | | - dependency-versions: "${{ matrix.dependencies }}" |
239 | | - |
240 | | - - name: "Lint container" |
241 | | - run: "(cd tests/Application && bin/console lint:container)" |
| 79 | + dependencies: "${{ matrix.dependencies }}" |
| 80 | + symfony: "${{ matrix.symfony }}" |
242 | 81 |
|
243 | | - - name: "Create database" |
244 | | - run: "(cd tests/Application && bin/console doctrine:database:create)" |
245 | | - |
246 | | - - name: "Create database schema" |
247 | | - run: "(cd tests/Application && bin/console doctrine:schema:create)" |
248 | | - |
249 | | - - name: "Validate Doctrine mapping" |
250 | | - run: "(cd tests/Application && bin/console doctrine:schema:validate)" |
251 | | - |
252 | 82 | mutation-tests: |
253 | | - name: "Mutation tests" |
254 | | - |
255 | 83 | runs-on: "ubuntu-latest" |
256 | | - |
257 | | - strategy: |
258 | | - matrix: |
259 | | - php-version: |
260 | | - - "8.2" |
261 | | - |
262 | | - dependencies: |
263 | | - - "highest" |
264 | | - |
265 | 84 | steps: |
266 | | - - name: "Checkout" |
267 | | - uses: "actions/checkout@v4" |
268 | | - |
269 | | - - name: "Setup PHP, with composer and extensions" |
270 | | - uses: "shivammathur/setup-php@v2" |
271 | | - with: |
272 | | - coverage: "pcov" |
273 | | - extensions: "${{ env.PHP_EXTENSIONS }}" |
274 | | - php-version: "${{ matrix.php-version }}" |
275 | | - |
276 | | - - name: "Install composer dependencies" |
277 | | - uses: "ramsey/composer-install@v2" |
| 85 | + - uses: "setono/sylius-plugin/mutation-tests@v2" |
278 | 86 | with: |
279 | | - dependency-versions: "${{ matrix.dependencies }}" |
| 87 | + stryker-dashboard-api-key: "${{ secrets.STRYKER_DASHBOARD_API_KEY }}" |
280 | 88 |
|
281 | | - - name: "Run infection" |
282 | | - run: "vendor/bin/infection" |
283 | | - env: |
284 | | - STRYKER_DASHBOARD_API_KEY: "${{ secrets.STRYKER_DASHBOARD_API_KEY }}" |
285 | | - |
286 | 89 | code-coverage: |
287 | | - name: "Code Coverage (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }})" |
288 | | - |
289 | 90 | runs-on: "ubuntu-latest" |
290 | | - |
291 | | - strategy: |
292 | | - matrix: |
293 | | - php-version: |
294 | | - - "8.2" |
295 | | - |
296 | | - dependencies: |
297 | | - - "highest" |
298 | | - |
299 | 91 | steps: |
300 | | - - name: "Checkout" |
301 | | - uses: "actions/checkout@v4" |
302 | | - |
303 | | - - name: "Setup PHP, with composer and extensions" |
304 | | - uses: "shivammathur/setup-php@v2" |
305 | | - with: |
306 | | - coverage: "pcov" |
307 | | - extensions: "${{ env.PHP_EXTENSIONS }}" |
308 | | - php-version: "${{ matrix.php-version }}" |
309 | | - |
310 | | - - name: "Set up problem matchers for phpunit/phpunit" |
311 | | - run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\"" |
312 | | - |
313 | | - - name: "Install composer dependencies" |
314 | | - uses: "ramsey/composer-install@v2" |
| 92 | + - uses: "setono/sylius-plugin/code-coverage@v2" |
315 | 93 | with: |
316 | | - dependency-versions: "${{ matrix.dependencies }}" |
317 | | - |
318 | | - - name: "Collect code coverage with pcov and phpunit/phpunit" |
319 | | - run: "vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml" |
320 | | - |
321 | | - - name: "Send code coverage report to Codecov.io" |
322 | | - env: |
323 | | - CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" |
324 | | - run: "bash <(curl -s https://codecov.io/bash)" |
| 94 | + codecov-token: "${{ secrets.CODECOV_TOKEN }}" |
0 commit comments