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.85k stars 334 forks source link

setup with cache will stuck #852

Closed ThanatosDi closed 1 month ago

ThanatosDi commented 1 month ago

Describe the bug

I want to use cache for the setup-php operation, with the following extensions installed: mongodb, redis, sqlite3, gd, bcmath. When executing the setup-php operation, it gets stuck because it asks whether to overwrite the mongodb.ini file that already exists.

Version

Runners

Operating systems

PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

PHP versions 8.2

To Reproduce

run action without cache will success and save cache at github, then run again the action will stuck

Expected behavior

success use cache and setup-php success.

Screenshots/Logs

image

Additional context

jobs:
  standard:
    runs-on: [ self-hosted, ci , '${{ github.repository }}' ]
    steps:
    - name: "Checkout"
      uses: actions/checkout@v4

    - name: "Setup PHP extension caching"
      id: extcache
      uses: shivammathur/cache-extensions@v1
      with:
        php-version: 8.2
        extensions: mongodb,redis,sqlite3,gd,bcmath
        key: php-extensions-${{ runner.os }}-foov4

    - name: "Cache extensions"
      uses: actions/cache@v4
      with:
        path: ${{ steps.extcache.outputs.dir }}
        key: ${{ steps.extcache.outputs.key }}-foov4
        restore-keys: ${{ steps.extcache.outputs.key }}-foov4

    - name: "Setup PHP"
      uses: shivammathur/setup-php@verbose
      with:
        php-version: 8.2
        extensions: mongodb,redis,sqlite3,gd,bcmath
        coverage: none

    - name: "Cache Composer dependencies"
      id: composer-dependencies
      uses: actions/cache@v4
      with:
        path: vendor
        key: composer-dependencies-${{ runner.os }}-foov4-${{ hashFiles('salary2020-3.43.1/composer.json') }}
        restore-keys: |
          composer-dependencies-${{ runner.os }}-foov4-${{ hashFiles('salary2020-3.43.1/composer.json') }}
          composer-dependencies-${{ runner.os }}-foov4-
          composer-dependencies-${{ runner.os }}-

Are you willing to submit a PR?

shivammathur commented 1 month ago

Should be fixed in https://github.com/shivammathur/setup-php/releases/tag/2.31.0 and https://github.com/shivammathur/cache-extensions/releases/tag/1.11.0