diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3709a74..f3035ea 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -207,8 +207,13 @@ jobs: > infection.json5 cat infection.json5 | jq - - name: "Cache Result cache" - uses: actions/cache@v4 + - name: "Determine default branch" + id: default-branch + 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 +222,9 @@ jobs: - name: "Run infection" run: | - git fetch --depth=1 origin $GITHUB_BASE_REF + git fetch --depth=1 origin ${{ steps.default-branch.outputs.name }} infection \ - --git-diff-base=origin/$GITHUB_BASE_REF \ + --git-diff-base=origin/${{ steps.default-branch.outputs.name }} \ --git-diff-lines \ --ignore-msi-with-no-mutations \ --min-msi=100 \ @@ -227,3 +232,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 }}" 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: