Skip to content

Commit

Permalink
Setup mutation testing
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and sebastianbergmann committed Apr 2, 2024
1 parent 8d485f1 commit f689597
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,37 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

mutation-test:
name: Mutation Testing

if: github.event_name == 'pull_request'

needs:
- end-to-end-tests

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: pcov
extensions: none, ctype, curl, date, dom, json, libxml, mbstring, phar, simplexml, soap, tokenizer, xml, xmlwriter, zlib
ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
tools: none

- name: Install dependencies with Composer
run: ./tools/composer install --no-ansi --no-interaction --no-progress

- name: Run mutation testing
run: |
git fetch origin $GITHUB_BASE_REF
php tools/infection.phar --threads=max --git-diff-lines --git-diff-base=origin/$GITHUB_BASE_REF --ignore-msi-with-no-mutations --only-covered
build-phar:
name: Build PHAR

Expand Down
12 changes: 12 additions & 0 deletions infection.json5.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "vendor/infection/infection/resources/schema.json",
"testFrameworkOptions": "--testsuite=unit",
"source": {
"directories": [
"src"
]
},
"mutators": {
"@default": true,
}
}
Binary file added tools/infection.phar
Binary file not shown.

0 comments on commit f689597

Please sign in to comment.