Skip to content

Merge pull request #585 from kamil-tekiela/Routine #619

Merge pull request #585 from kamil-tekiela/Routine

Merge pull request #585 from kamil-tekiela/Routine #619

name: Mutation tests
on:
push:
branches:
- master
- 6.0.x
pull_request:
branches:
- master
- 6.0.x
jobs:
tests:
name: Mutation tests with PHP ${{ matrix.php-version }}
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
php-version: ["8.2"]
operating-system: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Fetch github.base_ref (for diffing)
if: ${{ github.base_ref != '' }}
run: |
git fetch --depth=1 origin +refs/heads/${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
- name: Install PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
ini-values: memory_limit=-1
tools: composer:v2, infection:0.27.11
- name: Get Composer cache directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ runner.os }}-${{ matrix.php-version }}-${{ hashFiles('**/composer.*') }}
restore-keys: |
composer-${{ runner.os }}-${{ matrix.php-version }}-
- name: Install dependencies
run: |
composer update --no-interaction --no-progress
- name: Collect coverage report
run: composer run phpunit -- --stop-on-failure
- name: Infection
if: ${{ github.base_ref != '' }}
run: |
CHANGED_FILES=$(git diff origin/$GITHUB_BASE_REF --diff-filter=AM --name-only | grep src/ | paste -sd "," -);
infection -j$(nproc) --skip-initial-tests --no-interaction --no-progress --coverage=build/logs \
--ignore-msi-with-no-mutations \
--filter=$CHANGED_FILES
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
- name: Infection
if: ${{ github.base_ref == '' }}
run: |
infection -j$(nproc) --skip-initial-tests --no-interaction --no-progress --coverage=build/logs
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}