Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Mutation Testing

on:
workflow_dispatch:

permissions:
contents: read

concurrency:
group: mutation-${{ github.ref }}
cancel-in-progress: true

jobs:
mutation:
name: Infection
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP with PCOV
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: mbstring, xml, curl, intl, json, mysqlnd, sockets
coverage: pcov

- name: Install Composer dependencies
run: composer install --prefer-dist --no-progress --no-interaction

- name: Run Infection
run: composer infection -- --no-interaction

- name: Upload Infection report
if: always() && !cancelled()
uses: actions/upload-artifact@v4
with:
name: infection-report
path: |
build/logs/infection.html
build/logs/infection.json
if-no-files-found: warn
retention-days: 14
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
},
"require-dev": {
"fakerphp/faker": "^1.9",
"infection/infection": "^0.35.4",
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": "^13.0"
},
Expand All @@ -42,7 +43,10 @@
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"infection/extension-installer": true
}
},
"scripts": {
"test": "phpunit --testsuite UnitFeature --exclude-group integration,integration-websocket",
Expand All @@ -54,6 +58,7 @@
"test:all": "phpunit --exclude-group integration-websocket",
"test:coverage": "phpunit --colors --coverage-html build/logs/html",
"test:coverage:text": "phpunit --colors --coverage-text",
"infection": "@php -d memory_limit=1G vendor/bin/infection --threads=4 --show-mutations",
"analyse": "phpstan analyse --memory-limit=256M",
"cs-check": "php-cs-fixer fix --dry-run --diff",
"cs-fix": "php-cs-fixer fix"
Expand Down
Loading
Loading