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
49 changes: 49 additions & 0 deletions .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---

name: Mutation Tests

on: # yamllint disable-line rule:truthy
pull_request:
push:
branches: [1.x]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
contents: read

jobs:
mutation:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v6
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false

- name: 🛠️ Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
coverage: xdebug

- name: 📥 Install dependencies with composer
uses: ramsey/composer-install@v3
with:
dependency-versions: highest

# Not the Phar: its bundled testo/bridge-infection writes the unscoped `\Infection\StreamWrapper\IncludeInterceptor`
# into the mutant bootstrap, while the Phar ships the class as `Infected\...`, so every mutant fails with
# "class not found". Infection needs PHP 8.3+, so it is required here only, not in composer.json.
- name: 🧬 Install Infection
run: |
composer config allow-plugins.infection/extension-installer true
composer require --dev --no-interaction --no-progress infection/infection testo/bridge-infection

- name: 🧪 Run mutation testing
run: vendor/bin/infection --threads=max --logger-github --show-mutations=0 --min-msi=85
env:
STRYKER_DASHBOARD_API_KEY: ${{ github.event_name == 'push' && secrets.STRYKER_DASHBOARD_API_KEY || '' }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

[![Psalm Level](https://shepherd.dev/github/roadrunner-php/version-checker/level.svg)](https://shepherd.dev/github/roadrunner-php/version-checker)
[![Type Coverage](https://shepherd.dev/github/roadrunner-php/version-checker/coverage.svg)](https://shepherd.dev/github/roadrunner-php/version-checker)
[![Mutation testing badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Froadrunner-php%2Fversion-checker%2F1.x)](https://dashboard.stryker-mutator.io/reports/github.com/roadrunner-php/version-checker/1.x)

</div>

Expand Down
16 changes: 16 additions & 0 deletions infection.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://raw.githubusercontent.com/infection/infection/master/resources/schema.json",
"source": {
"directories": ["src"]
},
"testFramework": "testo",
"tmpDir": "runtime",
"timeout": 10,
"logs": {
"text": "runtime/infection.log",
"github": true,
"stryker": {
"report": "1.x"
}
}
}
Loading