Skip to content

Commit 5f39876

Browse files
authored
Fix mutation testing on dev branch (#166)
1 parent 68e0865 commit 5f39876

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,13 @@ jobs:
207207
> infection.json5
208208
cat infection.json5 | jq
209209
210-
- name: "Cache Result cache"
211-
uses: actions/cache@v4
210+
- name: "Determine default branch"
211+
id: default-branch
212+
run: |
213+
echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> $GITHUB_OUTPUT
214+
215+
- name: "Restore result cache"
216+
uses: actions/cache/restore@v4
212217
with:
213218
path: ./tmp
214219
key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"
@@ -217,13 +222,20 @@ jobs:
217222
218223
- name: "Run infection"
219224
run: |
220-
git fetch --depth=1 origin $GITHUB_BASE_REF
225+
git fetch --depth=1 origin ${{ steps.default-branch.outputs.name }}
221226
infection \
222-
--git-diff-base=origin/$GITHUB_BASE_REF \
227+
--git-diff-base=origin/${{ steps.default-branch.outputs.name }} \
223228
--git-diff-lines \
224229
--ignore-msi-with-no-mutations \
225230
--min-msi=100 \
226231
--min-covered-msi=100 \
227232
--log-verbosity=all \
228233
--debug \
229234
--logger-text=php://stdout
235+
236+
- name: "Save result cache"
237+
uses: actions/cache/save@v4
238+
if: ${{ !cancelled() }}
239+
with:
240+
path: ./tmp
241+
key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ cs-fix:
2626

2727
.PHONY: phpstan
2828
phpstan:
29-
php vendor/bin/phpstan analyse -l 8 -c phpstan.neon src tests
29+
php vendor/bin/phpstan analyse -c phpstan.neon src tests

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ includes:
55
- vendor/phpstan/phpstan-phpunit/extension.neon
66

77
parameters:
8+
level: 8
89
resultCachePath: tmp/resultCache.php
910

1011
excludePaths:

0 commit comments

Comments
 (0)