Skip to content

Commit 9ccd7c4

Browse files
Add mutation testing to pipeline
1 parent 9fa7f28 commit 9ccd7c4

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ jobs:
4141
rm -f installer expected
4242
mv composer.phar /usr/local/bin/composer
4343
44+
- name: Install Xdebug
45+
run: |
46+
pecl install xdebug
47+
docker-php-ext-enable xdebug
48+
4449
- name: Checkout repository
4550
uses: actions/checkout@v2
4651
with:
@@ -51,4 +56,7 @@ jobs:
5156
run: composer update --working-dir ${{ env.INSTALL_PATH }}
5257

5358
- name: Run unit tests
54-
run: composer test --working-dir ${{ env.INSTALL_PATH }}
59+
run: composer test --working-dir ${{ env.INSTALL_PATH }}
60+
61+
- name: Run mutation tests
62+
run: composer infect --working-dir ${{ env.INSTALL_PATH }}

composer.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"ext-ctype": "*"
4040
},
4141
"require-dev": {
42-
"phpunit/phpunit": "~9.0"
42+
"phpunit/phpunit": "~9.0",
43+
"infection/infection": "^0.25.5"
4344
},
4445
"autoload": {
4546
"psr-4": {
@@ -52,7 +53,8 @@
5253
}
5354
},
5455
"scripts": {
55-
"test": "phpunit tests/"
56+
"test": "phpunit tests/",
57+
"infect": "XDEBUG_MODE=coverage infection --show-mutations"
5658
},
5759
"minimum-stability": "stable",
5860
"prefer-stable": true

infection.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "vendor/infection/infection/resources/schema.json",
3+
"source": {
4+
"directories": [
5+
"src"
6+
]
7+
},
8+
"mutators": {
9+
"@default": true
10+
}
11+
}

0 commit comments

Comments
 (0)