Valinor/.github/workflows/mutation.yml
dependabot[bot] 3bd6a8e834 chore(deps): bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-24 14:24:59 +01:00

58 lines
1.7 KiB
YAML

name: Mutation tests
on:
push:
branches:
- master
pull_request:
jobs:
mutation:
name: Mutation tests
runs-on: ubuntu-latest
env:
php-version: '8.1'
php-extensions: xdebug, yaml
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Needed for the `git diff` used below for Infection
- name: Setup cache environment
id: extcache
uses: shivammathur/cache-extensions@v1
with:
php-version: ${{ matrix.php }}
extensions: ${{ env.php-extensions }}
key: mutation-php-extensions-${{ runner.os }}-${{ env.php-version }}
- name: Cache PHP extensions
uses: actions/cache@v2
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.php-version }}
extensions: ${{ env.php-extensions }}
ini-values: zend.assertions=1
- uses: "ramsey/composer-install@v2"
- 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
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