shivammathur / setup-php

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
https://setup-php.com
MIT License
2.91k stars 339 forks source link

Could not install `decimal` extension on PHP 8.3.7 #845

Closed 2kai closed 4 months ago

2kai commented 4 months ago

Describe the bug I'd like to use decimal extension in GitHub Actions workflow but it couldn't be installed with the Setup PHP action. It is related to PHP 8.3.7 only, lower versions worked well.

Version

Runners

Operating systems

ubuntu-latest

PHP versions

8.3.7

To Reproduce

steps:
  - name: Setup PHP
    uses: shivammathur/setup-php@v2
    with:
      php-version: '8.3'
      extensions: decimal

Expected behavior

decimal extension is successfully installed

Screenshots/Logs

==> Setup PHP
✓ PHP Installed PHP 8.3.7

==> Setup Extensions
✗ decimal Could not install decimal on PHP 8.3.7

Additional context

Are you willing to submit a PR?

Not yet.

lotyp commented 4 months ago

Interesting, I'm also using decimal extension in my CI workflow and project. I'm also using PHP 8.3 and it works, as I tested it now:

I've hardcoded 8.3.7 in this PR, to test this issue.

Here is code:

https://github.com/wayofdev/laravel-starter-tpl/pull/396/files#diff-dfd15ae70247bb45f121522ec2e50e5da9aed17e23116d94ec887a4769c44294R160

image

And here is CI job:

https://github.com/wayofdev/laravel-starter-tpl/actions/runs/9302702568/job/25603445285?pr=396

Job screenshot:

Screenshot 2024-05-30 at 15 47 03

Workflow code:

  coding-standards:
    timeout-minutes: 4
    runs-on: ${{ matrix.os }}
    concurrency:
      cancel-in-progress: true
      group: coding-standards-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
    strategy:
      matrix:
        os:
          - ubuntu-latest
        php-version:
          - '8.3'
        dependencies:
          - locked
    permissions:
      contents: write
    steps:
      - name: 🛠️ Setup PHP
        uses: shivammathur/setup-php@2.30.4
        with:
          php-version: '8.3.7'
          extensions: none, ctype, dom, json, mbstring, simplexml, tokenizer, xml, xmlwriter, pdo, curl, fileinfo, pdo_mysql, decimal
          ini-values: error_reporting=E_ALL
          coverage: none
2kai commented 4 months ago

@lotyp just in case - you can't hardcode PHP version to minor part. So either you put 8.3.7 or 8.3.6 script will read it as 8.3 and install the latest.

I compared operating system, runner image - I have the same you have. I tried your set of extensions. Result is exactly the same.

image

I don't have much time these days but on Sat I'll try to clone Setup PHP repo and run it locally.

lotyp commented 4 months ago

I've changed hardcoded 8.3.7 to use php-version: ${{ matrix.php-version }} which resolves to 8.3 in my workflow and it still succeeded:

image

Strange, as we are using same PHP version, same runners (ubuntu-latest).

lotyp commented 4 months ago

@2kai you can try to re-run job with enabled debugging, maybe there will be more detailed error?

Also, maybe this project can help you to debug your problem locally, by running workflow on your machine: https://github.com/nektos/act

shivammathur commented 4 months ago

@2kai Please use ubuntu-20.04 or ubuntu-22.04 for decimal extension and it should install correctly.

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