From c92b7ba5ca56bdd0b1a0f875a096b73a2dc34162 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 13:28:42 +0200 Subject: [PATCH 01/17] Setup integration tests --- .github/workflows/tests.yml | 82 +++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..ac4fafb --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,82 @@ +# https://help.github.com/en/categories/automating-your-workflow-with-github-actions + +name: "Tests" + +on: + pull_request: + push: + branches: + - "1.x" + +concurrency: + group: tests-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches + cancel-in-progress: true + +jobs: + tests-integration: + name: "Integration tests" + runs-on: "ubuntu-latest" + timeout-minutes: 60 + + + strategy: + fail-fast: false + matrix: + extension-name: + - "phpstan-doctrine" + - "extension-installer" + - "phpstan-phpunit" + - "phpstan-mockery" + - "phpstan-symfony" + #- "phpstan-nette" + #- "phpstan-webmozart-assert" + #- "phpstan-beberlei-assert" + #- "phpstan-deprecation-rules" + #- "phpstan-dibi" + #- "phpstan-strict-rules" + #- "phpstan-src" + + steps: + - name: "Checkout extension" + uses: actions/checkout@v5 + with: + repository: "phpstan/${{ matrix.extension-name }}" + + - name: "Checkout build-infection" + uses: actions/checkout@v5 + with: + path: "build-infection" + + - name: "Install PHP" + uses: "shivammathur/setup-php@v2" + with: + coverage: "none" + php-version: "8.3" + + - name: "Install dependencies" + working-directory: "build-infection" + run: "composer install --no-interaction --no-progress" + + - name: "Configure mutators" + run: cp build-infection/resources/infection.json5 . + + - name: "Cache Result cache" + uses: actions/cache@v4 + with: + path: ./tmp + key: "result-cache-v1-${{ github.run_id }}" + restore-keys: | + result-cache-v1- + + - name: "Run infection" + run: | + git fetch --depth=1 origin $GITHUB_BASE_REF + infection \ + --git-diff-base=origin/$GITHUB_BASE_REF \ + --git-diff-lines \ + --ignore-msi-with-no-mutations \ + --min-msi=100 \ + --min-covered-msi=100 \ + --log-verbosity=all \ + --debug \ + --logger-text=php://stdout From 692373f252b953c6afcd50f0f15ecfeb0bc10d6a Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 13:29:44 +0200 Subject: [PATCH 02/17] Update tests.yml --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ac4fafb..3f35ab0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -64,9 +64,9 @@ jobs: uses: actions/cache@v4 with: path: ./tmp - key: "result-cache-v1-${{ github.run_id }}" + key: "result-cache-v1-${{ matrix.extension-name }}-${{ github.run_id }}" restore-keys: | - result-cache-v1- + result-cache-v1-${{ matrix.extension-name }}- - name: "Run infection" run: | From 7c330b1b77f6a9d4041e1d27f8a63a539bc71a6d Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 13:33:58 +0200 Subject: [PATCH 03/17] determine default branch --- .github/workflows/tests.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3f35ab0..754c8ff 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,11 +68,17 @@ jobs: restore-keys: | result-cache-v1-${{ matrix.extension-name }}- + - name: "Determine default branch" + id: default-branch + working-directory: phpstan-dist + run: | + echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> $GITHUB_OUTPUT + - name: "Run infection" run: | - git fetch --depth=1 origin $GITHUB_BASE_REF + git fetch --depth=1 origin ${{ steps.previous-commit.outputs.name }} infection \ - --git-diff-base=origin/$GITHUB_BASE_REF \ + --git-diff-base=origin/${{ steps.previous-commit.outputs.name }} \ --git-diff-lines \ --ignore-msi-with-no-mutations \ --min-msi=100 \ From 2e52e28b39a89186d6b25e93098c22073cec4162 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 13:35:27 +0200 Subject: [PATCH 04/17] Update tests.yml --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 754c8ff..247a416 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -50,8 +50,9 @@ jobs: - name: "Install PHP" uses: "shivammathur/setup-php@v2" with: - coverage: "none" + coverage: "pcov" php-version: "8.3" + tools: "infection:0.31.7" - name: "Install dependencies" working-directory: "build-infection" From ade9f842052773c52e7bb1dfa78a7fd2f0d90913 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 13:40:44 +0200 Subject: [PATCH 05/17] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 247a416..333b833 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,7 +73,7 @@ jobs: id: default-branch working-directory: phpstan-dist run: | - echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> $GITHUB_OUTPUT + echo "name=$(basename $(git rev-parse --abbrev-ref origin/HEAD))" >> $GITHUB_OUTPUT - name: "Run infection" run: | From 8d3af7126f7beae359cbd41e567953105592c3ff Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 13:40:53 +0200 Subject: [PATCH 06/17] Update tests.yml --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 333b833..835df96 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,7 +71,6 @@ jobs: - name: "Determine default branch" id: default-branch - working-directory: phpstan-dist run: | echo "name=$(basename $(git rev-parse --abbrev-ref origin/HEAD))" >> $GITHUB_OUTPUT From cea9ea2a649a05b29c6d1ac3d280d5146fea640d Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 13:43:48 +0200 Subject: [PATCH 07/17] Update tests.yml --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 835df96..0d18494 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -76,9 +76,9 @@ jobs: - name: "Run infection" run: | - git fetch --depth=1 origin ${{ steps.previous-commit.outputs.name }} + git fetch --depth=1 origin ${{ steps.default-branch.outputs.name }} infection \ - --git-diff-base=origin/${{ steps.previous-commit.outputs.name }} \ + --git-diff-base=origin/${{ steps.default-branch.outputs.name }} \ --git-diff-lines \ --ignore-msi-with-no-mutations \ --min-msi=100 \ From c681df62551d82ac3ef77bf3044a8f1b3b5a616e Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 13:47:25 +0200 Subject: [PATCH 08/17] Update tests.yml --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0d18494..fbfaa1e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -16,7 +16,7 @@ jobs: tests-integration: name: "Integration tests" runs-on: "ubuntu-latest" - timeout-minutes: 60 + timeout-minutes: 30 strategy: @@ -72,7 +72,7 @@ jobs: - name: "Determine default branch" id: default-branch run: | - echo "name=$(basename $(git rev-parse --abbrev-ref origin/HEAD))" >> $GITHUB_OUTPUT + echo "name=$(git remote show [your_remote] | sed -n '/HEAD branch/s/.*: //p'))" >> $GITHUB_OUTPUT - name: "Run infection" run: | From 1e519bdf6a3f02628f1c1a1a5e25f569cf5265ea Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 13:47:35 +0200 Subject: [PATCH 09/17] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fbfaa1e..759b4be 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -72,7 +72,7 @@ jobs: - name: "Determine default branch" id: default-branch run: | - echo "name=$(git remote show [your_remote] | sed -n '/HEAD branch/s/.*: //p'))" >> $GITHUB_OUTPUT + echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p'))" >> $GITHUB_OUTPUT - name: "Run infection" run: | From ec00d4e5da1b0675a52da87d0fb3e27bc87fbd82 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 13:48:27 +0200 Subject: [PATCH 10/17] Update tests.yml --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 759b4be..8c4c5a8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -72,7 +72,7 @@ jobs: - name: "Determine default branch" id: default-branch run: | - echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p'))" >> $GITHUB_OUTPUT + echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> $GITHUB_OUTPUT - name: "Run infection" run: | From adc05da63dc28712e1d78cb46f15afbe7487b08b Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 13:49:29 +0200 Subject: [PATCH 11/17] Update tests.yml --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8c4c5a8..e1e7ca8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -79,7 +79,6 @@ jobs: git fetch --depth=1 origin ${{ steps.default-branch.outputs.name }} infection \ --git-diff-base=origin/${{ steps.default-branch.outputs.name }} \ - --git-diff-lines \ --ignore-msi-with-no-mutations \ --min-msi=100 \ --min-covered-msi=100 \ From a314ac2042ce61f849af9bb39c641c57ceaa4667 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 13:50:30 +0200 Subject: [PATCH 12/17] Update tests.yml --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e1e7ca8..c8de206 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -78,7 +78,6 @@ jobs: run: | git fetch --depth=1 origin ${{ steps.default-branch.outputs.name }} infection \ - --git-diff-base=origin/${{ steps.default-branch.outputs.name }} \ --ignore-msi-with-no-mutations \ --min-msi=100 \ --min-covered-msi=100 \ From 2cc1e363d4627a608a07d1e0eca332e204d2fea1 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 14:06:19 +0200 Subject: [PATCH 13/17] Update tests.yml --- .github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c8de206..a9cc02c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,7 +24,6 @@ jobs: matrix: extension-name: - "phpstan-doctrine" - - "extension-installer" - "phpstan-phpunit" - "phpstan-mockery" - "phpstan-symfony" @@ -54,10 +53,13 @@ jobs: php-version: "8.3" tools: "infection:0.31.7" - - name: "Install dependencies" + - name: "Install build-infection dependencies" working-directory: "build-infection" run: "composer install --no-interaction --no-progress" + - name: "Install dependencies" + run: "composer install --no-interaction --no-progress" + - name: "Configure mutators" run: cp build-infection/resources/infection.json5 . From dc0c9b83e07adf5dc87242513fd49d9e5670bb36 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 18:41:04 +0200 Subject: [PATCH 14/17] Update tests.yml --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a9cc02c..a1accb5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,9 +24,9 @@ jobs: matrix: extension-name: - "phpstan-doctrine" - - "phpstan-phpunit" - - "phpstan-mockery" - - "phpstan-symfony" + #- "phpstan-phpunit" + #- "phpstan-mockery" + #- "phpstan-symfony" #- "phpstan-nette" #- "phpstan-webmozart-assert" #- "phpstan-beberlei-assert" From 9632b9c7379b0012027a00e9888de422f78bcc51 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 19:00:05 +0200 Subject: [PATCH 15/17] Update tests.yml --- .github/workflows/tests.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a1accb5..44d97b7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,14 +71,8 @@ jobs: restore-keys: | result-cache-v1-${{ matrix.extension-name }}- - - name: "Determine default branch" - id: default-branch - run: | - echo "name=$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')" >> $GITHUB_OUTPUT - - name: "Run infection" run: | - git fetch --depth=1 origin ${{ steps.default-branch.outputs.name }} infection \ --ignore-msi-with-no-mutations \ --min-msi=100 \ From a7860340eba037365affe96edb914d54480c311b Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sat, 25 Oct 2025 19:05:45 +0200 Subject: [PATCH 16/17] Update tests.yml --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 44d97b7..8816fed 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -60,8 +60,11 @@ jobs: - name: "Install dependencies" run: "composer install --no-interaction --no-progress" - - name: "Configure mutators" - run: cp build-infection/resources/infection.json5 . + - name: "Configure infection" + run: | + php build-infection/bin/infection-config.php \ + > infection.json5 + cat infection.json5 | jq - name: "Cache Result cache" uses: actions/cache@v4 From 1c998e13989786b24215ec2c408711ff3d4aaf10 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Sun, 26 Oct 2025 09:38:23 +0100 Subject: [PATCH 17/17] Update tests.yml --- .github/workflows/tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8816fed..15fc483 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -78,8 +78,6 @@ jobs: run: | infection \ --ignore-msi-with-no-mutations \ - --min-msi=100 \ - --min-covered-msi=100 \ --log-verbosity=all \ --debug \ --logger-text=php://stdout