Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- "2.0.x"

concurrency:
group: build-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches
cancel-in-progress: true

jobs:
lint:
name: "Lint"
Expand Down Expand Up @@ -159,3 +163,67 @@ jobs:

- name: "PHPStan"
run: "make phpstan"

mutation-testing:
name: "Mutation Testing"
runs-on: "ubuntu-latest"
needs: ["tests", "static-analysis"]

strategy:
fail-fast: false
matrix:
php-version:
- "8.2"
- "8.3"
- "8.4"
operating-system: [ubuntu-latest]

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

- name: "Checkout build-infection"
uses: actions/checkout@v5
with:
repository: "phpstan/build-infection"
path: "build-infection"
ref: "1.x"

- uses: ./build-infection/.github/actions/setup-php
with:
php-version: "${{ matrix.php-version }}"
extensions: mbstring

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

- name: "Install build-infection dependencies"
working-directory: "build-infection"
run: "composer install --no-interaction --no-progress"

- name: "Configure infection"
run: |
php build-infection/bin/infection-config.php \
> infection.json5
cat infection.json5 | jq

- name: "Cache Result cache"
uses: actions/cache@v4
with:
path: ./tmp
key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"
restore-keys: |
result-cache-v1-${{ matrix.php-version }}-

- name: "Run infection"
run: |
git fetch --depth=1 origin $GITHUB_BASE_REF
infection \
--git-diff-base=origin/$GITHUB_BASE_REF \
--git-diff-lines \
--ignore-msi-with-no-mutations \
--min-msi=100 \
--min-covered-msi=100 \
--log-verbosity=all \
--debug \
--logger-text=php://stdout
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ includes:
- vendor/phpstan/phpstan-phpunit/extension.neon

parameters:
resultCachePath: tmp/resultCache.php

excludePaths:
- tests/*/data/*
3 changes: 2 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
failOnWarning="true"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xml"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
executionOrder="random"
>
<coverage>
<include>
Expand Down
Loading