Commit d647c277 authored by Jeremy Morrell's avatar Jeremy Morrell Committed by GitHub

Merge branch 'master' into changelog

parents b801e3f0 15e68450
...@@ -2,5 +2,8 @@ language: bash ...@@ -2,5 +2,8 @@ language: bash
sudo: required sudo: required
services: services:
- docker - docker
install: docker pull heroku/cedar:14 env:
script: make test - STACK=heroku-16
- STACK=cedar-14
install: docker pull "heroku/${STACK/-/:}"
script: make test-${STACK}
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
## Master ## Master
- Add `$STACK` to the cache signature (#445)
- Log output now differentiates between an empty cache and a new cache signature
## v107 (2017-07-17) ## v107 (2017-07-17)
- Switch to using nodebin to download the yarn binary (#444) - Switch to using nodebin to download the yarn binary (#444)
......
source $BP_DIR/lib/binaries.sh source $BP_DIR/lib/binaries.sh
create_signature() { create_signature() {
echo "$(node --version); $(npm --version); $(yarn --version 2>/dev/null || true) $PREBUILD" echo "${STACK}; $(node --version); $(npm --version); $(yarn --version 2>/dev/null || true); ${PREBUILD}"
} }
save_signature() { save_signature() {
...@@ -19,6 +19,8 @@ load_signature() { ...@@ -19,6 +19,8 @@ load_signature() {
get_cache_status() { get_cache_status() {
if ! ${NODE_MODULES_CACHE:-true}; then if ! ${NODE_MODULES_CACHE:-true}; then
echo "disabled" echo "disabled"
elif ! test -d "${CACHE_DIR}/node/"; then
echo "not-found"
elif [ "$(create_signature)" != "$(load_signature)" ]; then elif [ "$(create_signature)" != "$(load_signature)" ]; then
echo "new-signature" echo "new-signature"
else else
......
...@@ -54,12 +54,13 @@ testBuildWithCache() { ...@@ -54,12 +54,13 @@ testBuildWithCache() {
cache=$(mktmpdir) cache=$(mktmpdir)
compile "stable-node" $cache compile "stable-node" $cache
assertCaptured "Skipping cache restore (new-signature" assertCaptured "Skipping cache restore (not-found)"
assertEquals "1" "$(ls -1 $cache/node/node_modules | grep hashish | wc -l | tr -d ' ')" assertEquals "1" "$(ls -1 $cache/node/node_modules | grep hashish | wc -l | tr -d ' ')"
assertCapturedSuccess assertCapturedSuccess
compile "stable-node" $cache compile "stable-node" $cache
assertNotCaptured "- node_modules (not cached - skipping)" assertNotCaptured "- node_modules (not cached - skipping)"
assertFileContains "${STACK}" "${cache}/node/signature"
assertCapturedSuccess assertCapturedSuccess
rm -rf "$cache/node/node_modules" rm -rf "$cache/node/node_modules"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment