Skip to content

Commit e00346a

Browse files
committed
Fix mutation testing on dev branch
1 parent 68e0865 commit e00346a

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
@@ -207,8 +207,14 @@ 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+
working-directory: phpstan-dist
213+
run: |
214+
echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> $GITHUB_OUTPUT
215+
216+
- name: "Restore result cache"
217+
uses: actions/cache/restore@v4
212218
with:
213219
path: ./tmp
214220
key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"
@@ -217,13 +223,20 @@ jobs:
217223
218224
- name: "Run infection"
219225
run: |
220-
git fetch --depth=1 origin $GITHUB_BASE_REF
226+
git fetch --depth=1 origin ${{ steps.previous-commit.outputs.name }}
221227
infection \
222-
--git-diff-base=origin/$GITHUB_BASE_REF \
228+
--git-diff-base=origin/${{ steps.previous-commit.outputs.name }} \
223229
--git-diff-lines \
224230
--ignore-msi-with-no-mutations \
225231
--min-msi=100 \
226232
--min-covered-msi=100 \
227233
--log-verbosity=all \
228234
--debug \
229235
--logger-text=php://stdout
236+
237+
- name: "Save result cache"
238+
uses: actions/cache/save@v4
239+
if: ${{ !cancelled() }}
240+
with:
241+
path: ./tmp
242+
key: "result-cache-v1-${{ matrix.php-version }}-${{ github.run_id }}"

0 commit comments

Comments
 (0)