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
57 changes: 10 additions & 47 deletions .github/workflows/infection.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,24 @@
---

name: 🧬 Mutation Tests

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

name: 🧬 Mutation Tests

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

permissions:
contents: read

jobs:
infection:
name: Infection · PHP ${{ matrix.php-version }}
timeout-minutes: 10
runs-on: ${{ matrix.os }}
concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
group: infection-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ matrix.php-version }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
php-version:
- '8.4'
dependencies:
- highest
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v6
with:
persist-credentials: false

- name: 🛠️ Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
extensions: pdo, pdo_sqlite
ini-values: error_reporting=E_ALL
coverage: xdebug

- name: 📥 Install dependencies with composer
uses: ramsey/composer-install@v3
env:
COMPOSER_ROOT_VERSION: '1.x-dev'
with:
dependency-versions: ${{ matrix.dependencies }}

- name: 📥 Install Infection
run: composer bin infection install --no-interaction --no-progress
name: Infection
uses: cycle/gh-actions/.github/workflows/infection.yml@master
secrets: inherit

- name: 🧬 Run mutation testing with Infection
run: composer infect:ci
env:
# Upload the report to the Stryker dashboard only on push to 1.x.
# On pull requests (and forks) the key is empty, so Infection skips the upload
# instead of overwriting the branch report with PR data.
STRYKER_DASHBOARD_API_KEY: ${{ github.event_name == 'push' && secrets.STRYKER_DASHBOARD_API_KEY || '' }}
...
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"roxblnfk/unpoly": "^1.8",
"spiral/boot": "^3.18",
"spiral/cycle-bridge": "^2.13",
"testo/bridge-infection": "^0.1.9",
"testo/testo": "^0.10.60",
"yiisoft/di": "^1.4"
},
Expand Down Expand Up @@ -72,14 +71,20 @@
"infect": [
"Composer\\Config::disableProcessTimeout",
"@putenv XDEBUG_MODE=coverage",
"@putenv DB_DRIVERS=sqlite",
"infection --configuration=infection.json --threads=max"
],
"infect:ci": [
"Composer\\Config::disableProcessTimeout",
"@putenv XDEBUG_MODE=coverage",
"infection --ansi --configuration=infection.json --logger-github --threads=max --show-mutations=0 --min-msi=50"
"@putenv DB_DRIVERS=sqlite",
"infection --ansi --configuration=infection.json --logger-github --threads=max --show-mutations=0"
]
},
"scripts-descriptions": {
"infect": "Run mutation testing with Infection (install it first: composer bin infection install)",
"infect:ci": "Run mutation testing in CI: GitHub annotations and the MSI thresholds"
},
"extra": {
"laravel": {
"providers": [
Expand Down
3 changes: 2 additions & 1 deletion infection.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
]
},
"timeout": 10,
"minMsi": 95,
"minCoveredMsi": 95,
"testFramework": "testo",
"testFrameworkOptions": "--suite=Unit",
"tmpDir": "runtime",
"logs": {
"stryker": {
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/infection/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"infection/infection": "^0.35",
"infection/infection": "^0.35.12",
"testo/bridge-infection": "^0.1.9"
},
"config": {
Expand Down
Loading