Skip to content

Bug: PHPUnit versions changed without configuration changeย #1000

Closed

Description

@SMillerDev

Describe the bug

Earlier this week setup-php installed PHPUnit 10.5.55 when requesting 10.5.x and today it is serving 10.5.9:

Version

  • v2
  • v1

Runners

GitHub Hosted

Operating systems

ubuntu-24.04 in GitHub CI

PHP versions

Any PHP version is affected. This job is pointing to PHP 8.1

To Reproduce

      - name: Set up PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.1'
          tools: phpunit:10.5.x
          extensions: uopz
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expected behavior

Installing the latest PHPUnit release in the 10.5.x range (10.5.55 at the time of writing)

Screenshots/Logs

No response

Additional context

No response

Are you willing to submit a PR?

No

Activity

  1. shivammathur commented on Sep 17, 2025

    @shivammathur
    Owner

    Fixed in 8f81967

  2. SMillerDev commented on Sep 17, 2025

    @SMillerDev
    Author

    Thanks!

  3. pprkut commented on Sep 18, 2025

    @pprkut

    This indeed fixed the phpunit issue we were facing, but it seems to have a regression for phpcs.

    Run shivammathur/setup-php@8f8196743c19b9fcb7b11d926cfab463116c3ae9
      with:
        php-version: 8.1
        tools: cs2pr, phpcs:3.x
        ini-file: production
        github-token: ***
    Error: Invalid argument not valid semver ('3.0.0RC1' received)
    
  4. shivammathur commented on Sep 18, 2025

    @shivammathur
    Owner

    @pprkut Thanks for reporting this

  5. MatteoFattorini commented on Sep 18, 2025

    @MatteoFattorini

    @shivammathur
    Weโ€™re seeing a version downgrade for stan too in our CI runners

    Nothing has changed in our composers.

    Example

    Before: phpstan 1.12.28
    Now: phpstan 1.9.9

  6. shivammathur commented on Sep 18, 2025

    @shivammathur
    Owner

    @pprkut @MatteoFattorini

    I have fixed this further in bf6b4fb.

    GitHub seems to have changed the matching refs API, they were sorted earlier and it worked. Should work correctly once these fixes are released.

    Test workflow: https://github.com/shivammathur/test-setup-php/actions/runs/17826589779/workflow

  7. pprkut commented on Sep 18, 2025

    @pprkut

    @shivammathur Yes! I can confirm it works correctly now in our CI and it installs the right versions for phpunit, phpcs and phpstan. Thank you! ๐Ÿ™‚

  8. LorenzoRogai commented on Sep 18, 2025

    @LorenzoRogai

    phpstan 1.9.9 instead of 1.12.28 is still being pulled from our side

  9. rodrigoprimo commented on Sep 18, 2025

    @rodrigoprimo

    Was this fix released already?

    We are still seeing this issue in the WPCS repository. I just triggered a new GitHub Actions build, and it failed due to an incorrect PHPStan version: https://github.com/WordPress/WordPress-Coding-Standards/actions/runs/17828454462/job/50687177814?pr=2572

  10. shivammathur commented on Sep 18, 2025

    @shivammathur
    Owner

    @LorenzoRogai @rodrigoprimo The fixes are still in the develop branch, please wait for the next release. I will try to do it later today or tomorrow.

  11. LorenzoRogai commented on Sep 18, 2025

    @LorenzoRogai

    Will the fix also revert phpcs/phpcbf from 4 to 3.13.4?

  12. shivammathur commented on Sep 18, 2025

    @shivammathur
    Owner

    @LorenzoRogai
    tools: phpcs or tools: phpcs:4 should setup 4.0.0 which is the latest tag currently.
    tools: phpcs:3 should setup 3.13.4

  13. shivammathur commented on Sep 18, 2025

    @shivammathur
    Owner

    Released the fixes in 2.35.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions