blob: ad08a5ca874220dc19d18216f417f3cebc16eb6f (
plain)
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
68
69
70
71
72
|
# https://docs.github.com/en/actions
name: Mutation tests
on:
push:
branches:
- master
paths:
- '*/classes/**.php'
pull_request:
branches:
- master
paths:
- '*/classes/**.php'
permissions:
contents: read
jobs:
infection:
name: Infection
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
php-version:
- "8.1"
operating-system:
- ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Gettext
run: sudo apt-get install -y gettext
- name: Generate mo files
run: ./scripts/generate-mo --quiet
- 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: composer:v2, phive
- name: Install Infection
# The GPG key can be found at https://infection.github.io/guide/installation.html
run: phive --no-progress install --target ./build/tools --trust-gpg-keys C5095986493B4AA0 infection
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
with:
dependency-versions: highest
- name: Collect coverage report
run: composer run phpunit -- --testsuite unit --stop-on-failure
- name: Run Infection for changed files only
if: github.event_name == 'pull_request'
run: |
git fetch --depth=1 origin $GITHUB_BASE_REF
./build/tools/infection -j$(nproc) --git-diff-lines --git-diff-base=origin/$GITHUB_BASE_REF \
--logger-github --ignore-msi-with-no-mutations --only-covered \
--skip-initial-tests --coverage=build/logs --no-interaction --no-progress
- name: Run Infection
if: github.event_name == 'push'
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
run: ./build/tools/infection -j$(nproc) --skip-initial-tests --coverage=build/logs --no-interaction --no-progress
|