-
-
Notifications
You must be signed in to change notification settings - Fork 92
67 lines (61 loc) · 2.02 KB
/
Copy pathmutation.yml
File metadata and controls
67 lines (61 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Mutation tests
on:
push:
branches:
- master
pull_request:
jobs:
mutation:
name: Mutation tests
runs-on: ubuntu-latest
env:
php-version: '8.5'
php-extensions: ds,yaml
steps:
- name: Checkout
uses: actions/checkout@v4
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
coverage: pcov
- uses: "ramsey/composer-install@v2"
with:
composer-options: "--ignore-platform-reqs" # Remove when Psalm supports PHP 8.5
- name: Creating var directory
run: mkdir -p var/cache
- name: Cache Mutation results
uses: actions/cache@v4
with:
path: var/cache
key: mutation-${{ hashFiles('composer.lock') }}-${{ hashFiles('.github/workflows/mutation.yml') }}
restore-keys: mutation-${{ hashFiles('composer.lock') }}-${{ hashFiles('.github/workflows/mutation.yml') }}
- name: Running mutation tests
if: github.ref == 'refs/heads/master'
run: |
php vendor/bin/infection --threads=$(nproc) \
--with-uncovered \
--with-timeouts \
--show-mutations
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 \
--with-uncovered \
--max-timeouts=0 \
--min-msi=100 \
--show-mutations \
--verbose \
--logger-text=php://stdout \
--debug