Skip to content

Commit

Permalink
Add mutation testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Slamdunk committed Aug 19, 2020
1 parent 7a0e5e6 commit 7e5d274
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/composer-require-checker.json export-ignore
/box.json.dist export-ignore
/Makefile export-ignore
/infection.json.dist export-ignore
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/phpunit.xml.dist export-ignore
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,47 @@ jobs:
timeout-minutes: 10
run: "vendor/bin/phpunit"

mutation-tests:
name: "Mutation Tests"

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "7.4"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
php-version: "${{ matrix.php-version }}"
tools: composer:v1
extensions: sqlite

- name: "Get composer cache directory"
id: composercache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: "Cache dependencies"
uses: actions/cache@v2
with:
path: ${{ steps.composercache.outputs.dir }}
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ matrix.dependencies }}-composer-

- name: "Install dependencies"
run: "composer update --no-interaction --no-progress"

- name: "Infection"
run: "vendor/bin/infection -j4"
env:
INFECTION_BADGE_API_KEY: ${{ secrets.INFECTION_BADGE_API_KEY }}

code-coverage:
name: "Code Coverage"

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"doctrine/coding-standard": "^8.1.0",
"ekino/phpstan-banned-code": "^0.3.1",
"ergebnis/phpstan-rules": "^0.15.1",
"infection/infection": "^0.17.2",
"phpstan/phpstan": "^0.12.37",
"phpstan/phpstan-deprecation-rules": "^0.12.5",
"phpstan/phpstan-phpunit": "^0.12.16",
Expand Down
19 changes: 19 additions & 0 deletions infection.json.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"source": {
"directories": [
"src"
]
},
"timeout": 10,
"logs": {
"text": "php:\/\/stderr",
"badge": {
"branch": "master"
}
},
"mutators": {
"@default": true
},
"minMsi": 79,
"minCoveredMsi": 88
}

0 comments on commit 7e5d274

Please sign in to comment.