Skip to content

Commit 11f3ada

Browse files
authored
Fix mutation testing on dev branch (#244)
1 parent 53e33fc commit 11f3ada

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,13 @@ jobs:
261261
> infection.json5
262262
cat infection.json5 | jq
263263
264-
- name: "Cache Result cache"
265-
uses: actions/cache@v4
264+
- name: "Determine default branch"
265+
id: default-branch
266+
run: |
267+
echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> $GITHUB_OUTPUT
268+
269+
- name: "Restore result cache"
270+
uses: actions/cache/restore@v4
266271
with:
267272
path: ./tmp
268273
key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"
@@ -271,13 +276,20 @@ jobs:
271276
272277
- name: "Run infection"
273278
run: |
274-
git fetch --depth=1 origin $GITHUB_BASE_REF
279+
git fetch --depth=1 origin ${{ steps.default-branch.outputs.name }}
275280
infection \
276-
--git-diff-base=origin/$GITHUB_BASE_REF \
281+
--git-diff-base=origin/${{ steps.default-branch.outputs.name }} \
277282
--git-diff-lines \
278283
--ignore-msi-with-no-mutations \
279284
--min-msi=100 \
280285
--min-covered-msi=100 \
281286
--log-verbosity=all \
282287
--debug \
283288
--logger-text=php://stdout
289+
290+
- name: "Save result cache"
291+
uses: actions/cache/save@v4
292+
if: ${{ !cancelled() }}
293+
with:
294+
path: ./tmp
295+
key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ 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
3030

3131
.PHONY: phpstan-generate-baseline
3232
phpstan-generate-baseline:
33-
php vendor/bin/phpstan analyse -l 8 -c phpstan.neon src tests -b phpstan-baseline.neon
33+
php vendor/bin/phpstan analyse -c phpstan.neon src tests -b phpstan-baseline.neon

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ includes:
77
- phpstan-baseline.neon
88

99
parameters:
10+
level: 8
1011
reportUnmatchedIgnoredErrors: false
1112

1213
resultCachePath: tmp/resultCache.php

0 commit comments

Comments
 (0)