forked from phpmyadmin/phpmyadmin
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (65 loc) · 2.1 KB
/
mutation-tests.yml
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
73
74
75
76
# https://docs.github.com/en/actions
name: Mutation tests
on:
push:
branches:
- master
paths:
- 'src/**.php'
- 'tests/unit/**.php'
pull_request:
branches:
- master
paths:
- 'src/**.php'
- 'tests/unit/**.php'
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
permissions:
contents: read
jobs:
infection:
name: Infection
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
php-version:
- "8.2"
operating-system:
- ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Checkout base ref code
if: github.event_name == 'pull_request'
uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
- name: Install Gettext
run: sudo apt-get install -y gettext
- name: Generate mo files
run: ./bin/generate-mo --quiet
- name: Set up PHP ${{ matrix.php-version }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: composer:v2, infection
- name: Install Composer dependencies
uses: ramsey/composer-install@v2
- name: Run Infection for changed files only
if: github.event_name == 'push' || github.event_name == 'pull_request'
run: |
if [ "$GITHUB_EVENT_NAME" = "push" ]; then \
INFECTION_GIT_DIFF_BASE="origin/$GITHUB_REF_NAME^"; else \
INFECTION_GIT_DIFF_BASE="origin/$GITHUB_BASE_REF"; fi
infection --threads=max --git-diff-lines --git-diff-base="$INFECTION_GIT_DIFF_BASE" \
--logger-github --ignore-msi-with-no-mutations --only-covered --no-interaction --no-progress
- name: Run Infection for all files
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}
run: infection --threads=max --no-interaction --log-verbosity=none --logger-github=false