Skip to content

Commit 62505bb

Browse files
authored
Merge pull request #7 from Setono/upgrade
Upgrade to Sylius 2
2 parents 0bc3ec0 + 76f8c5e commit 62505bb

141 files changed

Lines changed: 2287 additions & 1052 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/backwards-compatibility-check.yaml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/build.yaml

Lines changed: 43 additions & 273 deletions
Original file line numberDiff line numberDiff line change
@@ -1,324 +1,94 @@
11
name: "build"
2+
23
on:
34
push:
45
branches:
5-
- "master"
6-
paths-ignore:
7-
- "**/*.md"
8-
pull_request:
9-
paths-ignore:
10-
- "**/*.md"
6+
- "*.x"
7+
pull_request: ~
118
workflow_dispatch: ~
129

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-
1810
jobs:
19-
coding-standards:
20-
name: "Coding Standards (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }})"
21-
11+
backwards-compatibility:
2212
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'"
3214
steps:
33-
- name: "Checkout"
34-
uses: "actions/checkout@v4"
15+
- uses: "setono/sylius-plugin/backwards-compatibility@v2"
3516

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"
6621

6722
dependency-analysis:
68-
name: "Dependency Analysis (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})"
69-
7023
runs-on: "ubuntu-latest"
71-
7224
strategy:
25+
fail-fast: false
7326
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"]
8630
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"
9232
with:
93-
coverage: "none"
94-
extensions: "${{ env.PHP_EXTENSIONS }}"
9533
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 }}"
10736

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-
11437
static-code-analysis:
115-
name: "Static Code Analysis (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})"
116-
11738
runs-on: "ubuntu-latest"
118-
11939
strategy:
40+
fail-fast: false
12041
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"]
13345
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"
13947
with:
140-
coverage: "none"
141-
extensions: "${{ env.PHP_EXTENSIONS }}"
14248
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 }}"
15751

15852
unit-tests:
159-
name: "Unit tests (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})"
160-
16153
runs-on: "ubuntu-latest"
162-
16354
strategy:
55+
fail-fast: false
16456
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"]
17760
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"
18362
with:
184-
coverage: "none"
185-
extensions: "${{ env.PHP_EXTENSIONS }}"
18663
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 }}"
20166

67+
functional-tests:
20268
runs-on: "ubuntu-latest"
203-
20469
strategy:
70+
fail-fast: false
20571
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"]
21875
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"
22777
with:
228-
coverage: "none"
229-
extensions: "${{ env.PHP_EXTENSIONS }}"
23078
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 }}"
24281

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-
25282
mutation-tests:
253-
name: "Mutation tests"
254-
25583
runs-on: "ubuntu-latest"
256-
257-
strategy:
258-
matrix:
259-
php-version:
260-
- "8.2"
261-
262-
dependencies:
263-
- "highest"
264-
26584
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"
27886
with:
279-
dependency-versions: "${{ matrix.dependencies }}"
87+
stryker-dashboard-api-key: "${{ secrets.STRYKER_DASHBOARD_API_KEY }}"
28088

281-
- name: "Run infection"
282-
run: "vendor/bin/infection"
283-
env:
284-
STRYKER_DASHBOARD_API_KEY: "${{ secrets.STRYKER_DASHBOARD_API_KEY }}"
285-
28689
code-coverage:
287-
name: "Code Coverage (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }})"
288-
28990
runs-on: "ubuntu-latest"
290-
291-
strategy:
292-
matrix:
293-
php-version:
294-
- "8.2"
295-
296-
dependencies:
297-
- "highest"
298-
29991
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"
31593
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

Comments
 (0)