Skip to content

Commit 15bece3

Browse files
committed
Did some housekeeping chores here including:
* Add PHP 8.5 support * Add some tests and mutation tests, using phpstan for them
1 parent cf0a9f7 commit 15bece3

30 files changed

+1545
-759
lines changed

.github/workflows/coding-standard.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
dependencies:
2121
- "locked"
2222
php-version:
23-
- "8.4"
23+
- "8.5"
2424
operating-system:
2525
- "ubuntu-latest"
2626

@@ -31,10 +31,8 @@ jobs:
3131
- name: "Install PHP"
3232
uses: "shivammathur/setup-php@2.36.0"
3333
with:
34-
coverage: "pcov"
3534
php-version: "${{ matrix.php-version }}"
3635
ini-values: memory_limit=-1
37-
extensions: pdo_sqlite
3836

3937
- uses: ramsey/composer-install@3.1.1
4038
with:

.github/workflows/docs-check.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
dependencies:
2020
- "locked"
2121
php-version:
22-
- "8.4"
22+
- "8.5"
2323
operating-system:
2424
- "ubuntu-latest"
2525

@@ -33,7 +33,6 @@ jobs:
3333
coverage: none
3434
php-version: "${{ matrix.php-version }}"
3535
ini-values: memory_limit=-1, opcache.enable_cli=1
36-
extensions: pdo_sqlite
3736

3837
- uses: ramsey/composer-install@3.1.1
3938
with:
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Mutation tests on diff"
4+
5+
on:
6+
pull_request:
7+
8+
jobs:
9+
mutation-tests-diff:
10+
name: "Mutation tests on diff"
11+
12+
runs-on: ${{ matrix.operating-system }}
13+
14+
strategy:
15+
matrix:
16+
dependencies:
17+
- "locked"
18+
php-version:
19+
- "8.5"
20+
operating-system:
21+
- "ubuntu-latest"
22+
23+
steps:
24+
- name: "Checkout"
25+
uses: actions/checkout@v6
26+
with:
27+
fetch-depth: 0
28+
29+
- name: "Install PHP"
30+
uses: "shivammathur/setup-php@2.36.0"
31+
with:
32+
coverage: "pcov"
33+
php-version: "${{ matrix.php-version }}"
34+
ini-values: memory_limit=-1
35+
extensions: pdo_sqlite
36+
37+
- uses: ramsey/composer-install@3.1.1
38+
with:
39+
dependency-versions: ${{ matrix.dependencies }}
40+
41+
- name: "Infection"
42+
run: "vendor/bin/infection --threads=max --git-diff-lines --git-diff-base=origin/$GITHUB_BASE_REF --ignore-msi-with-no-mutations --with-uncovered --min-msi=90 --min-covered-msi=95"
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "Mutation tests"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "[0-9]+.[0-9]+.x"
10+
- "renovate/*"
11+
12+
jobs:
13+
mutation-tests:
14+
name: "Mutation tests"
15+
16+
runs-on: ${{ matrix.operating-system }}
17+
18+
strategy:
19+
matrix:
20+
dependencies:
21+
- "locked"
22+
php-version:
23+
- "8.5"
24+
operating-system:
25+
- "ubuntu-latest"
26+
27+
steps:
28+
- name: "Checkout"
29+
uses: actions/checkout@v6
30+
31+
- name: "Install PHP"
32+
uses: "shivammathur/setup-php@2.36.0"
33+
with:
34+
coverage: "pcov"
35+
php-version: "${{ matrix.php-version }}"
36+
ini-values: memory_limit=-1
37+
extensions: pdo_sqlite
38+
39+
- uses: ramsey/composer-install@3.1.1
40+
with:
41+
dependency-versions: ${{ matrix.dependencies }}
42+
43+
- name: "Infection"
44+
run: "vendor/bin/infection --threads=max"
45+
env:
46+
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}

.github/workflows/phpstan.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
dependencies:
2121
- "locked"
2222
php-version:
23-
- "8.4"
23+
- "8.5"
2424
operating-system:
2525
- "ubuntu-latest"
2626

@@ -31,10 +31,8 @@ jobs:
3131
- name: "Install PHP"
3232
uses: "shivammathur/setup-php@2.36.0"
3333
with:
34-
coverage: "pcov"
3534
php-version: "${{ matrix.php-version }}"
3635
ini-values: memory_limit=-1
37-
extensions: pdo_sqlite
3836

3937
- uses: ramsey/composer-install@3.1.1
4038
with:

.github/workflows/phpunit.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
name: "PHPUnit tests"
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches:
9+
- "[0-9]+.[0-9]+.x"
10+
- "renovate/*"
11+
12+
jobs:
13+
phpunit:
14+
name: "PHPUnit tests"
15+
16+
runs-on: ${{ matrix.operating-system }}
17+
18+
strategy:
19+
matrix:
20+
dependencies:
21+
- "lowest"
22+
- "highest"
23+
php-version:
24+
- "8.2"
25+
- "8.3"
26+
- "8.4"
27+
- "8.5"
28+
operating-system:
29+
- "ubuntu-latest"
30+
- "windows-latest"
31+
include:
32+
- dependencies: "locked"
33+
php-version: "8.5"
34+
operating-system: "ubuntu-latest"
35+
- dependencies: "locked"
36+
php-version: "8.5"
37+
operating-system: "windows-latest"
38+
steps:
39+
- name: "Checkout"
40+
uses: actions/checkout@v6
41+
42+
- name: "Install PHP"
43+
uses: "shivammathur/setup-php@2.36.0"
44+
with:
45+
coverage: "pcov"
46+
php-version: "${{ matrix.php-version }}"
47+
ini-values: memory_limit=-1
48+
extensions: pdo_sqlite
49+
50+
- uses: ramsey/composer-install@3.1.1
51+
with:
52+
dependency-versions: ${{ matrix.dependencies }}
53+
54+
- name: "Tests"
55+
run: "vendor/bin/phpunit --coverage-clover=clover.xml --coverage-text"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ phpunit.xml
55
.phpcs-cache
66
phpstan.neon
77
docs_php
8+
infection.html
9+
infection.log

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ phpstan-baseline: vendor
2424
phpunit: vendor ## run phpunit tests
2525
XDEBUG_MODE=coverage vendor/bin/phpunit
2626

27+
.PHONY: infection
28+
infection: vendor ## run infection
29+
php -d memory_limit=312M vendor/bin/infection --threads=5
30+
31+
.PHONY: infection-diff
32+
infection-diff: vendor ## run infection on differences
33+
php -d memory_limit=312M vendor/bin/infection --threads=max --git-diff-lines --git-diff-base=origin/HEAD --ignore-msi-with-no-mutations --only-covered --min-msi=80 --min-covered-msi=95
34+
2735
.PHONY: static
2836
static: psalm phpstan phpcs-check ## run static analyser
2937

composer.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,21 @@
1818
}
1919
],
2020
"require": {
21-
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
21+
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
2222
"illuminate/contracts": "^10.0 || ^11.0 || ^12.0",
2323
"patchlevel/event-sourcing": "^3.5"
2424
},
2525
"require-dev": {
2626
"ext-pdo_sqlite": "*",
27-
"infection/infection": "^0.31.0",
27+
"infection/infection": "^0.31.9",
2828
"larastan/larastan": "v3.8.0",
2929
"laravel/framework": "^10.0 || ^11.0 || ^12.0",
3030
"league/commonmark": "^2.4",
3131
"orchestra/testbench": "^10.6",
3232
"patchlevel/coding-standard": "^1.3.0",
33-
"phpstan/phpstan": "^2.1.16",
34-
"phpunit/phpunit": "^12.1.5",
33+
"phpstan/phpstan": "^2.1.32",
34+
"phpunit/phpunit": "^11.5.45",
3535
"roave/security-advisories": "dev-master",
36-
"symfony/var-dumper": "^6.4.0 || ^7.0.0",
3736
"wnx/commonmark-markdown-renderer": "^1.4"
3837
},
3938
"config": {
@@ -64,5 +63,13 @@
6463
"Patchlevel\\LaravelEventSourcing\\EventSourcingServiceProvider"
6564
]
6665
}
66+
},
67+
"scripts": {
68+
"post-autoload-dump": [
69+
"@clear",
70+
"@prepare"
71+
],
72+
"clear": "@php vendor/bin/testbench package:purge-skeleton --ansi",
73+
"prepare": "@php vendor/bin/testbench package:discover --ansi"
6774
}
68-
}
75+
}

0 commit comments

Comments
 (0)