shivammathur / cache-extensions

:package: Cache PHP extensions in GitHub Actions
https://github.com/marketplace/actions/cache-php-extensions
MIT License
50 stars 6 forks source link

Cache not found #45

Open B0bbyD0llar opened 2 weeks ago

B0bbyD0llar commented 2 weeks ago

Describe the bug

The process appears to run smoothly. The network load suggests that quite a bit of data is being loaded. The output in the step indicates that the data was correctly stored in the cache. However, in the next step, it shows that the cache could not be found. Additionally, setting up PHP takes just as long as when no cache is configured.

Version

Runners

Operating systems ubuntu-latest (Ubuntu 2404)

PHP versions 8.2

To Reproduce

    strategy:
      matrix:
        php-version:
          - "8.2"
    env:
      extensions: apcu, calendar, ctype, curl, ds, dom, fileinfo, filter, iconv, intl, json, ldap, mbstring, mysqlnd, pdo, pdo_mysql, pdo_sqlite
      key: "cache-v6"

    steps:
      - name: "Checkout"
        uses: "actions/checkout@v4.2.2"
      - name: "Setup php extensions cache environment"
        id: extcache
        uses: "shivammathur/cache-extensions@1.11.1"
        with:
          php-version: "${{ matrix.php-version }}"
          extensions: "${{ env.extensions }}"
          key: "${{ env.key }}"
      - name: "Show key information"
        run: |
          echo ${{ env.key }}
          echo ${{ steps.extcache.outputs.dir }}
          echo ${{ steps.extcache.outputs.key }}
      - name: "Cache php extensions"
        uses: "actions/cache@v4.1.2"
        with:
          path: "${{ steps.extcache.outputs.dir }}"
          key: "${{ steps.extcache.outputs.key }}"
          restore-keys: "${{ steps.extcache.outputs.key }}"
      - name: "Set up PHP"
        uses: "shivammathur/setup-php@2.31.1"
        with:
          coverage: "none"
          extensions:  apcu, calendar, ctype, curl, ds, dom, fileinfo, filter, gd, iconv, imap, intl, json, ldap, mbstring, mysqlnd, pdo, pdo_mysql, pdo_sqlite, redis, session, simplexml, tokenizer, xml, xmlreader, xmlwriter, zip, zlib
          php-version: ${{ matrix.php-version }}
        env:
          runner: self-hosted

Expected behavior

Cache size should not be ~0MB, and the cache should be found. Also, the setup-PHP step should run faster than when there are no cached extensions.

Screenshots/Logs

Additional context In this workflow, caching is already successfully used elsewhere (php-cs-fixer and composer), so I can rule out any issues with the caching functionality itself.

M-arcus commented 1 day ago

I am facing the same issue, should I post a file too?