Skip to content

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Sep 20, 2025

make use of ondrejmirtes/simple-downgrader#14

downgrading phpstan-src in CI before this PR took ~10min (windows) and ~4m30s (ubuntu)

we are now down to ~15-25 seconds

with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
php-version: "8.4"
Copy link
Member

Choose a reason for hiding this comment

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

I'd do this a bit differently:

  1. Install ${{ matrix.php-version }}
  2. Run the composer steps
  3. Only when downgrading: install 8.4
  4. Transform source code
  5. Only when downgrading: install ${{ matrix.php-version }} again

You can try playing with https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action to see if we can achieve DRY across different workflows.

Copy link
Member

Choose a reason for hiding this comment

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

What I want to avoid is always start by installing 8.4 which is immediately going to be ovewritten with matrix version.

Copy link
Contributor Author

@staabm staabm Sep 20, 2025

Choose a reason for hiding this comment

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

I'd do this a bit differently:

done

You can try playing with docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action to see if we can achieve DRY across different workflows.

I would do that in a followup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure what todo with the "Compile PHAR" - or what the actual problem is.

Copy link
Member

Choose a reason for hiding this comment

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

Can you link the failure? I don't see anything big.

If you mean "Checksum PHAR" - that's fine. The idea behind that job is that the PHAR checksum should not change when src/ doesn't change.

If we change something about the compilation process then it's fine if PHAR contents change. I suspect that some ConstFetches now use FQN like \null so the source slightly changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you mean "Checksum PHAR" - that's fine.

yep, that one. wasn't sure what it means

@staabm staabm marked this pull request as ready for review September 20, 2025 19:35
@phpstan-bot
Copy link
Collaborator

This pull request has been marked as ready for review.

run: "composer install --no-interaction --no-progress"

- name: "Change to simple-downgrade PHP version"
uses: "shivammathur/setup-php@v2"
Copy link
Member

Choose a reason for hiding this comment

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

No if condition here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
php-version: "8.4"
Copy link
Member

Choose a reason for hiding this comment

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

Can you link the failure? I don't see anything big.

If you mean "Checksum PHAR" - that's fine. The idea behind that job is that the PHAR checksum should not change when src/ doesn't change.

If we change something about the compilation process then it's fine if PHAR contents change. I suspect that some ConstFetches now use FQN like \null so the source slightly changed.

@ondrejmirtes ondrejmirtes merged commit 7776279 into phpstan:2.1.x Sep 20, 2025
454 of 457 checks passed
@ondrejmirtes
Copy link
Member

Really great! 🎉

@staabm staabm deleted the upgr branch September 20, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants