Use cache for 'npm ci'

[MAILPOET-1837]
This commit is contained in:
Jan Jakeš
2019-02-28 16:32:50 +01:00
committed by M. Shull
parent eef5f47a1a
commit 4c2f187880
3 changed files with 7 additions and 5 deletions

View File

@ -11,7 +11,9 @@ jobs:
- restore_cache:
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
- restore_cache:
key: npm-{{ checksum "package.json" }}
keys:
- npm-{{ checksum "package-lock.json" }}
- npm- # fallback to most recent npm-* if not found by checksum
- run:
name: "Set up test environment"
command: |
@ -33,9 +35,9 @@ jobs:
paths:
- vendor
- save_cache:
key: npm-{{ checksum "package.json" }}
key: npm-{{ checksum "package-lock.json" }}
paths:
- node_modules
- ~/.npm
- run:
name: "Composer security check"
command: |

View File

@ -8,7 +8,7 @@ class RoboFile extends \Robo\Tasks {
return $this->taskExecStack()
->stopOnFail()
->exec('./composer.phar install')
->exec('npm ci')
->exec('npm ci --prefer-offline')
->run();
}

View File

@ -19,7 +19,7 @@ mkdir $plugin_name
# Production assets.
echo '[BUILD] Generating production CSS and JS assets'
rm -rf node_modules
npm ci
npm ci --prefer-offline
./do compile:all --env production
# Dependency injection container cache.