Skip to content

Commit ce0ee98

Browse files
committed
Fix mutation testing on dev branch
1 parent 53e33fc commit ce0ee98

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,14 @@ 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+
working-directory: phpstan-dist
267+
run: |
268+
echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> $GITHUB_OUTPUT
269+
270+
- name: "Restore result cache"
271+
uses: actions/cache/restore@v4
266272
with:
267273
path: ./tmp
268274
key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"
@@ -271,13 +277,20 @@ jobs:
271277
272278
- name: "Run infection"
273279
run: |
274-
git fetch --depth=1 origin $GITHUB_BASE_REF
280+
git fetch --depth=1 origin ${{ steps.default-branch.outputs.name }}
275281
infection \
276-
--git-diff-base=origin/$GITHUB_BASE_REF \
282+
--git-diff-base=origin/${{ steps.default-branch.outputs.name }} \
277283
--git-diff-lines \
278284
--ignore-msi-with-no-mutations \
279285
--min-msi=100 \
280286
--min-covered-msi=100 \
281287
--log-verbosity=all \
282288
--debug \
283289
--logger-text=php://stdout
290+
291+
- name: "Save result cache"
292+
uses: actions/cache/save@v4
293+
if: ${{ !cancelled() }}
294+
with:
295+
path: ./tmp
296+
key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"

0 commit comments

Comments
 (0)