-
-
Notifications
You must be signed in to change notification settings - Fork 113
59 lines (51 loc) · 1.79 KB
/
mutation-tests.yml
File metadata and controls
59 lines (51 loc) · 1.79 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
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 code
uses: actions/checkout@v4
- 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: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
ini-values: memory_limit=-1
tools: infection
- name: Install Composer dependencies
uses: ramsey/composer-install@v3
- 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 }}