2021-11-28 17:43:02 +01:00
|
|
|
name: Mutation tests
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
jobs:
|
|
|
|
mutation:
|
|
|
|
name: Mutation tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2021-11-29 13:24:11 +01:00
|
|
|
php-version: '8.1'
|
2021-11-28 17:43:02 +01:00
|
|
|
php-extensions: xdebug, yaml
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2022-03-07 07:16:46 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-11-28 17:43:02 +01:00
|
|
|
with:
|
|
|
|
fetch-depth: 0 # Needed for the `git diff` used below for Infection
|
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ env.php-version }}
|
|
|
|
extensions: ${{ env.php-extensions }}
|
|
|
|
ini-values: zend.assertions=1
|
|
|
|
|
2022-01-11 16:17:53 +01:00
|
|
|
- uses: "ramsey/composer-install@v2"
|
2021-11-28 17:43:02 +01:00
|
|
|
|
|
|
|
- name: Creating var directory
|
|
|
|
run: mkdir -p var/cache
|
|
|
|
|
|
|
|
- name: Running mutation tests
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
run: php vendor/bin/infection --threads=$(nproc)
|
|
|
|
env:
|
|
|
|
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
|
|
|
|
|
|
|
|
- name: Running mutation tests
|
|
|
|
if: github.event_name == 'pull_request'
|
|
|
|
run: |
|
|
|
|
git fetch --depth=1 origin $GITHUB_BASE_REF
|
2022-01-11 19:15:03 +01:00
|
|
|
php vendor/bin/infection --threads=$(nproc) --git-diff-lines --git-diff-base=origin/$GITHUB_BASE_REF --logger-github --ignore-msi-with-no-mutations --only-covered
|