Skip to content

Mutation Test

Mutation Test #38

name: Mutation Test
on:
schedule:
- cron: '0 0 * * *'
pull_request:
push:
branches:
- 1.x
paths:
- .github/workflows/mutation-tests.yml
- src/**
- composer.json
- infection.json5
concurrency:
group: mutation-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
tests:
strategy:
fail-fast: false
matrix:
php-version:
- '8.4'
name: Mutation Tests
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
ini-values: display_errors=On, display_startup_errors=On, error_reporting=-1, zend.assertions=1, assert.exception=1, memory_limit=2048M
- name: Setup global variables
id: globals
shell: bash
run: |
echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.globals.outputs.COMPOSER_CACHE_DIR }}
key: ${{ github.workflow }}-PHP_${{ matrix.php-version }}-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ github.workflow }}-PHP_${{ matrix.php-version }}-
- name: Install dependencies
run: |
composer update --ansi
- name: Run Mutation Testing
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
git fetch --depth=1 origin $GITHUB_BASE_REF
composer mutation:filter
else
composer mutation:check
fi
env:
INFECTION_DASHBOARD_API_KEY: ${{ secrets.INFECTION_DASHBOARD_API_KEY }}