Skip to content

Commit b2218d0

Browse files
committed
Upgrade test application and dependencies
1 parent 690db91 commit b2218d0

File tree

69 files changed

+299
-836
lines changed

Some content is hidden

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

69 files changed

+299
-836
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: Setono

.github/dependabot.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# See https://github.com/Roave/BackwardCompatibilityCheck
2+
3+
name: "Backwards Compatibility Check"
4+
5+
on:
6+
pull_request: ~
7+
8+
jobs:
9+
backwards-compatibility-check:
10+
name: "Backwards Compatibility Check"
11+
12+
runs-on: "ubuntu-latest"
13+
14+
steps:
15+
- name: "Checkout"
16+
uses: "actions/checkout@v4"
17+
with:
18+
fetch-depth: 0
19+
20+
- name: "Setup PHP, with composer and extensions"
21+
uses: "shivammathur/setup-php@v2"
22+
with:
23+
php-version: "8.1"
24+
coverage: "none"
25+
26+
- name: "Install tool"
27+
run: "composer global require roave/backward-compatibility-check"
28+
29+
- name: "Check for BC breaks"
30+
run: "~/.composer/vendor/bin/roave-backward-compatibility-check --from=origin/${{ github.event.pull_request.base.ref }} --format=github-actions"

.github/workflows/build.yaml

Lines changed: 90 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: "build"
22
on:
33
push:
4+
branches:
5+
- "3.x"
46
paths-ignore:
57
- "**/*.md"
68
pull_request:
@@ -22,14 +24,14 @@ jobs:
2224
strategy:
2325
matrix:
2426
php-version:
25-
- "7.4"
27+
- "8.1" # Always use the lowest version of PHP since a higher version could create actual syntax errors in lower versions
2628

2729
dependencies:
2830
- "highest"
2931

3032
steps:
3133
- name: "Checkout"
32-
uses: "actions/checkout@v3"
34+
uses: "actions/checkout@v4"
3335

3436
- name: "Setup PHP, with composer and extensions"
3537
uses: "shivammathur/setup-php@v2"
@@ -39,7 +41,7 @@ jobs:
3941
coverage: "none"
4042

4143
- name: "Install composer dependencies"
42-
uses: "ramsey/composer-install@v2"
44+
uses: "ramsey/composer-install@v3"
4345
with:
4446
dependency-versions: "${{ matrix.dependencies }}"
4547

@@ -52,6 +54,10 @@ jobs:
5254
- name: "Check style"
5355
run: "composer check-style"
5456

57+
- name: "Rector"
58+
run: "vendor/bin/rector process --dry-run"
59+
continue-on-error: true
60+
5561
- name: "Lint yaml files"
5662
run: "(cd tests/Application && bin/console lint:yaml ../../src/Resources)"
5763

@@ -66,41 +72,45 @@ jobs:
6672
strategy:
6773
matrix:
6874
php-version:
69-
- "7.4"
70-
- "8.0"
7175
- "8.1"
76+
- "8.2"
7277

7378
dependencies:
79+
- "lowest"
7480
- "highest"
75-
81+
7682
symfony:
77-
- "^5.4"
83+
- "~5.4.0"
84+
- "~6.4.0"
7885

7986
steps:
8087
- name: "Checkout"
81-
uses: "actions/checkout@v3"
88+
uses: "actions/checkout@v4"
8289

8390
- name: "Setup PHP, with composer and extensions"
8491
uses: "shivammathur/setup-php@v2"
8592
with:
8693
coverage: "none"
8794
extensions: "${{ env.PHP_EXTENSIONS }}"
8895
php-version: "${{ matrix.php-version }}"
89-
tools: "composer-require-checker, composer-unused, flex"
96+
tools: "flex"
9097

98+
- name: "Remove require-dev section in composer.json"
99+
run: "composer config --unset require-dev"
100+
101+
- name: "Add shipmonk/composer-dependency-analyser to composer.json"
102+
run: "composer require --dev --no-install --no-update --no-plugins --no-scripts shipmonk/composer-dependency-analyser"
103+
91104
- name: "Install composer dependencies"
92-
uses: "ramsey/composer-install@v2"
105+
uses: "ramsey/composer-install@v3"
93106
env:
94107
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
95108
with:
96109
dependency-versions: "${{ matrix.dependencies }}"
97110

98-
- name: "Run maglnet/composer-require-checker"
99-
run: "composer-require-checker check --config-file=$(pwd)/composer-require-checker.json"
100-
101-
- name: "Run composer-unused/composer-unused"
102-
run: "composer-unused"
103-
111+
- name: "Run dependency analysis"
112+
run: "vendor/bin/composer-dependency-analyser"
113+
104114
static-code-analysis:
105115
name: "Static Code Analysis (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }} | SF${{ matrix.symfony }})"
106116

@@ -109,19 +119,20 @@ jobs:
109119
strategy:
110120
matrix:
111121
php-version:
112-
- "7.4"
113-
- "8.0"
114122
- "8.1"
123+
- "8.2"
115124

116125
dependencies:
126+
- "lowest"
117127
- "highest"
118128

119129
symfony:
120-
- "^5.4"
130+
- "~5.4.0"
131+
- "~6.4.0"
121132

122133
steps:
123134
- name: "Checkout"
124-
uses: "actions/checkout@v3"
135+
uses: "actions/checkout@v4"
125136

126137
- name: "Setup PHP, with composer and extensions"
127138
uses: "shivammathur/setup-php@v2"
@@ -131,16 +142,16 @@ jobs:
131142
php-version: "${{ matrix.php-version }}"
132143
tools: "flex"
133144

145+
- name: "Remove sylius/sylius from composer.json"
146+
run: "composer remove --dev --no-install --no-update --no-plugins --no-scripts sylius/sylius"
147+
134148
- name: "Install composer dependencies"
135-
uses: "ramsey/composer-install@v2"
149+
uses: "ramsey/composer-install@v3"
136150
env:
137151
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
138152
with:
139153
dependency-versions: "${{ matrix.dependencies }}"
140154

141-
- name: "Cache warmup"
142-
run: "(cd tests/Application && bin/console cache:warmup)"
143-
144155
- name: "Static analysis"
145156
run: "vendor/bin/psalm --php-version=${{ matrix.php-version }}"
146157

@@ -152,19 +163,20 @@ jobs:
152163
strategy:
153164
matrix:
154165
php-version:
155-
- "7.4"
156-
- "8.0"
157166
- "8.1"
158-
167+
- "8.2"
168+
159169
dependencies:
170+
- "lowest"
160171
- "highest"
161172

162173
symfony:
163-
- "^5.4"
174+
- "~5.4.0"
175+
- "~6.4.0"
164176

165177
steps:
166178
- name: "Checkout"
167-
uses: "actions/checkout@v3"
179+
uses: "actions/checkout@v4"
168180

169181
- name: "Setup PHP, with composer and extensions"
170182
uses: "shivammathur/setup-php@v2"
@@ -175,7 +187,7 @@ jobs:
175187
tools: "flex"
176188

177189
- name: "Install composer dependencies"
178-
uses: "ramsey/composer-install@v2"
190+
uses: "ramsey/composer-install@v3"
179191
env:
180192
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
181193
with:
@@ -192,22 +204,23 @@ jobs:
192204
strategy:
193205
matrix:
194206
php-version:
195-
- "7.4"
196-
- "8.0"
197207
- "8.1"
208+
- "8.2"
198209

199210
dependencies:
211+
- "lowest"
200212
- "highest"
201-
213+
202214
symfony:
203-
- "^5.4"
215+
- "~5.4.0"
216+
- "~6.4.0"
204217

205218
steps:
206219
- name: "Start MySQL"
207220
run: "sudo /etc/init.d/mysql start"
208221

209222
- name: "Checkout"
210-
uses: "actions/checkout@v3"
223+
uses: "actions/checkout@v4"
211224

212225
- name: "Setup PHP, with composer and extensions"
213226
uses: "shivammathur/setup-php@v2"
@@ -218,7 +231,7 @@ jobs:
218231
tools: "flex"
219232

220233
- name: "Install composer dependencies"
221-
uses: "ramsey/composer-install@v2"
234+
uses: "ramsey/composer-install@v3"
222235
env:
223236
SYMFONY_REQUIRE: "${{ matrix.symfony }}"
224237
with:
@@ -234,8 +247,42 @@ jobs:
234247
run: "(cd tests/Application && bin/console doctrine:schema:create)"
235248

236249
- name: "Validate Doctrine mapping"
237-
run: "(cd tests/Application && bin/console doctrine:schema:validate)"
250+
run: "(cd tests/Application && bin/console doctrine:schema:validate -vvv)" # The verbose flag will show 'missing' SQL statements, if any
251+
252+
mutation-tests:
253+
name: "Mutation tests"
254+
255+
runs-on: "ubuntu-latest"
256+
257+
strategy:
258+
matrix:
259+
php-version:
260+
- "8.2"
261+
262+
dependencies:
263+
- "highest"
264+
265+
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 }}"
238275

276+
- name: "Install composer dependencies"
277+
uses: "ramsey/composer-install@v3"
278+
with:
279+
dependency-versions: "${{ matrix.dependencies }}"
280+
281+
- name: "Run infection"
282+
run: "vendor/bin/infection"
283+
env:
284+
STRYKER_DASHBOARD_API_KEY: "${{ secrets.STRYKER_DASHBOARD_API_KEY }}"
285+
239286
code-coverage:
240287
name: "Code Coverage (PHP${{ matrix.php-version }} | Deps: ${{ matrix.dependencies }})"
241288

@@ -244,14 +291,14 @@ jobs:
244291
strategy:
245292
matrix:
246293
php-version:
247-
- "8.1"
294+
- "8.2"
248295

249296
dependencies:
250297
- "highest"
251298

252299
steps:
253300
- name: "Checkout"
254-
uses: "actions/checkout@v3"
301+
uses: "actions/checkout@v4"
255302

256303
- name: "Setup PHP, with composer and extensions"
257304
uses: "shivammathur/setup-php@v2"
@@ -260,18 +307,15 @@ jobs:
260307
extensions: "${{ env.PHP_EXTENSIONS }}"
261308
php-version: "${{ matrix.php-version }}"
262309

263-
- name: "Set up problem matchers for phpunit/phpunit"
264-
run: "echo \"::add-matcher::${{ runner.tool_cache }}/phpunit.json\""
265-
266310
- name: "Install composer dependencies"
267-
uses: "ramsey/composer-install@v2"
311+
uses: "ramsey/composer-install@v3"
268312
with:
269313
dependency-versions: "${{ matrix.dependencies }}"
270314

271315
- name: "Collect code coverage with pcov and phpunit/phpunit"
272316
run: "vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml"
273317

274318
- name: "Send code coverage report to Codecov.io"
275-
env:
276-
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
277-
run: "bash <(curl -s https://codecov.io/bash)"
319+
uses: "codecov/codecov-action@v4"
320+
with:
321+
token: "${{ secrets.CODECOV_TOKEN }}"

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Setono
3+
Copyright (c) 2025 Setono
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)