Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
branches:
- "2.0.x"

concurrency:
group: build-${{ github.head_ref || github.run_id }} # will be canceled on subsequent pushes in pull requests but not branches
cancel-in-progress: true

jobs:
lint:
name: "Lint"
Expand Down Expand Up @@ -169,7 +173,7 @@ jobs:
php-version: "${{ matrix.php-version }}"
ini-file: development
extensions: pdo, mysqli, pgsql, pdo_mysql, pdo_pgsql, pdo_sqlite, mongodb
tools: infection:0.31.6
tools: infection:0.31.7

- name: "Allow installing on PHP 8.4"
if: matrix.php-version == '8.4'
Expand All @@ -178,10 +182,27 @@ jobs:
- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"

- uses: "actions/download-artifact@v4"
- name: "Checkout build-infection"
uses: actions/checkout@v5
with:
name: "result-cache-${{ matrix.php-version }}"
path: "tmp/"
repository: "phpstan/build-infection"
path: "build-infection"
ref: "1.x"

- name: "Install build-infection dependencies"
working-directory: "build-infection"
run: "composer install --no-interaction --no-progress"

- name: "Configure mutators"
run: cp build-infection/resources/infection.json5 .
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, here we take the config 1:1 from build-infection

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just FYI in phpstan-src I'll also want to add https://github.com/phpstan/phpstan-src/tree/2.1.x/build/PHPStan/Build because there are some tests for that in https://github.com/phpstan/phpstan-src/tree/2.1.x/tests/PHPStan/Build.

So if we're copying the whole config I'd still like to be able to modify it afterward.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a --source-directory='another/path' option

Copy link
Contributor Author

@staabm staabm Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I think whether it would make sense to move this phpstan-src/build/PHPStan/Build rules into a separate repo, as this might make sense to be re-used in 1st party extension repos?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're not relevant like that yet, mostly because phpstan-src can use PHP 8+ features thanks to downgrading and the extensions can't.


- name: "Cache Result cache"
uses: actions/cache@v4
with:
path: ./tmp
key: "result-cache-v14-${{ matrix.php-version }}-${{ github.run_id }}"
restore-keys: |
result-cache-v14-${{ matrix.php-version }}-

- name: "Run infection"
run: |
Expand Down Expand Up @@ -240,9 +261,3 @@ jobs:

- name: "PHPStan"
run: "make phpstan"

- uses: "actions/upload-artifact@v4"
Copy link
Contributor Author

@staabm staabm Oct 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of uploading/downloading artifacts for caching, I changed to use actions/cache because that way it also works on phpstan-src. special in phpstan-src is that the "static-analysis" and "test" jobs are spread across 2 workflows, which makes artifact handling otherwise complicated

with:
# "update-packages" is not relevant for the download-artifact counterpart, but we need it here to get unique artifact names across all jobs
name: "result-cache-${{ matrix.php-version }}${{ matrix.update-packages && '-packages-updated' || '' }}"
path: "tmp/resultCache.php"
17 changes: 0 additions & 17 deletions infection.json5

This file was deleted.

1 change: 0 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ parameters:
- tests/*/data-attributes/*
- tests/*/data-php-*/*
- tests/Rules/Doctrine/ORM/entity-manager.php
- tests/Infection/

reportUnmatchedIgnoredErrors: false

Expand Down
69 changes: 0 additions & 69 deletions tests/Infection/TrinaryLogicMutator.php

This file was deleted.

Loading