php-actions / composer

Use the Composer CLI in your Github Actions.
176 stars 56 forks source link

Cache not working on Github Actions #113

Closed scollovati closed 9 months ago

scollovati commented 9 months ago

The code provided here https://github.com/marketplace/actions/composer-php-actions#caching-dependencies-for-faster-builds does not cache the dependencies even when the composer.lock is unchanged. Code used

    - name: Cache Composer dependencies
      uses: actions/cache@v3
      with:
        path: /tmp/composer-cache
        key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

Result in any subsequent runs: Cache not found for input keys: Linux-5d81c3e7e1df5ec78472dc1e854896ce827c65fcbd46d320611f8ce178706295

I've tried also with actions/cache@v4, but the result is identical.

scollovati commented 9 months ago

Solved, the job was failing thus not caching at the end.