From e00346a00c80aae2aef911b38b9cce178a915e5d Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 26 Oct 2025 21:43:48 +0100 Subject: [PATCH 1/4] Fix mutation testing on dev branch --- .github/workflows/build.yml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3709a74..5453f4c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -207,8 +207,14 @@ jobs: > infection.json5 cat infection.json5 | jq - - name: "Cache Result cache" - uses: actions/cache@v4 + - name: "Determine default branch" + id: default-branch + working-directory: phpstan-dist + run: | + echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> $GITHUB_OUTPUT + + - name: "Restore result cache" + uses: actions/cache/restore@v4 with: path: ./tmp key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}" @@ -217,9 +223,9 @@ jobs: - name: "Run infection" run: | - git fetch --depth=1 origin $GITHUB_BASE_REF + git fetch --depth=1 origin ${{ steps.previous-commit.outputs.name }} infection \ - --git-diff-base=origin/$GITHUB_BASE_REF \ + --git-diff-base=origin/${{ steps.previous-commit.outputs.name }} \ --git-diff-lines \ --ignore-msi-with-no-mutations \ --min-msi=100 \ @@ -227,3 +233,10 @@ jobs: --log-verbosity=all \ --debug \ --logger-text=php://stdout + + - name: "Save result cache" + uses: actions/cache/save@v4 + if: ${{ !cancelled() }} + with: + path: ./tmp + key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}" From 204fd9b297d3c16c9ea5cb69223dbfde64ba2bd4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 26 Oct 2025 21:44:54 +0100 Subject: [PATCH 2/4] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5453f4c..6604115 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -223,9 +223,9 @@ jobs: - name: "Run infection" run: | - git fetch --depth=1 origin ${{ steps.previous-commit.outputs.name }} + git fetch --depth=1 origin ${{ steps.default-branch.outputs.name }} infection \ - --git-diff-base=origin/${{ steps.previous-commit.outputs.name }} \ + --git-diff-base=origin/${{ steps.default-branch.outputs.name }} \ --git-diff-lines \ --ignore-msi-with-no-mutations \ --min-msi=100 \ From fc5f6aaad5da85bb08b74d19783ba5de7b83989b Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 26 Oct 2025 21:47:37 +0100 Subject: [PATCH 3/4] Update build.yml --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6604115..f3035ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -209,7 +209,6 @@ jobs: - name: "Determine default branch" id: default-branch - working-directory: phpstan-dist run: | echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> $GITHUB_OUTPUT From cda1ff89909f1608edce9dc9d32bc23c35ae10e4 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 26 Oct 2025 21:57:34 +0100 Subject: [PATCH 4/4] move level config into phpstan.neon analog https://github.com/phpstan/phpstan-doctrine/commit/38fc20dce359703f48c076c9a9bab0e2cc30c533 --- Makefile | 2 +- phpstan.neon | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b2b6703..cfbcfbd 100644 --- a/Makefile +++ b/Makefile @@ -26,4 +26,4 @@ cs-fix: .PHONY: phpstan phpstan: - php vendor/bin/phpstan analyse -l 8 -c phpstan.neon src tests + php vendor/bin/phpstan analyse -c phpstan.neon src tests diff --git a/phpstan.neon b/phpstan.neon index 4a083f0..981c688 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -5,6 +5,7 @@ includes: - vendor/phpstan/phpstan-phpunit/extension.neon parameters: + level: 8 resultCachePath: tmp/resultCache.php excludePaths: