I am trying to add github actions workflow in my application. This is a new laravel app with default workflow from github with modifications on caching node_modules and vendor. Based on the logs, I was able to cache the vendor but not the node_modules
Below are the data added:
Cache Node Dependencies
Run actions/cache@v4
with:
path: **/node_modules
key: Linux-node-
restore-keys: Linux-node-
enableCrossOsArchive: false
fail-on-cache-miss: false
lookup-only: false
save-always: false
Cache not found for input keys: Linux-node-, Linux-node-
Cache PHP Dependencies
Run actions/cache@v4
with:
path: **/vendor
key: Linux-composer-
restore-keys: Linux-composer-
enableCrossOsArchive: false
fail-on-cache-miss: false
lookup-only: false
save-always: false
Cache Size: ~22 MB (22933639 B)
/usr/bin/tar -xf /home/runner/work/_temp/910c20f3-da02-4663-80dc-3a136c067ace/cache.tzst -P -C /home/runner/work/demoapp/demoapp --use-compress-program unzstd
Cache restored successfully
Cache restored from key: Linux-composer-
Post Cache Node Dependencies
Post job cleanup.
Warning: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.
Post Cache PHP Dependencies
Post job cleanup.
Cache hit occurred on the primary key Linux-composer-, not saving cache.
develop.yml workflow
name: Development Merging
on:
push:
branches: ["develop"]
pull_request:
branches: ["develop"]
jobs:
development-merging:
runs-on: ubuntu-latest
steps:
- uses: shivammathur/setup-php@15c43e89cdef867065b0213be354c2841860869e
with:
php-version: "8.3"
# Cache node_modules
- name: Cache Node.js dependencies
uses: actions/cache@v4
with:
path: |
**/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# Cache vendor directory
- name: Cache PHP dependencies
uses: actions/cache@v4
with:
path: |
**/vendor
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
... others
Why is the node_modules not caching?
PS. Not part of the main question but quick question. On Post Cache PHP Dependencies, is this the message when cache is used? Since the message before the message at the top was Cache saved successfully
.