Skip to content

Commit

Permalink
Ask TravisCI to cache the npm modules
Browse files Browse the repository at this point in the history
This commit asks TravisCI to cache the .npm directory, used by `npm
ci` to cached downloaded packages.

The .npm directory is also mounted into the build container, so that
if the host has cached .npm packages, so will the container.
  • Loading branch information
squaremo committed Feb 17, 2020
1 parent d1c34b3 commit 06fac3c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@ matrix:
- os: linux
services:
- docker
cache:
directories:
- "$HOME/.npm" # npm ci will remove node_modules; this is _its_ download cache
script:
- ./run-in-docker.sh make dep install test api-reference STATIC=yes

- os: osx
osx_image: xcode11.3
cache:
directories:
- "$HOME/.npm" # npm ci will remove node_modules; this is _its_ download cache
before_install:
# v8 prebuilt library
- git clone https://github.com/jkcfg/prebuilt.git
Expand Down
2 changes: 1 addition & 1 deletion run-in-docker.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

pkg=github.com/jkcfg/jk
docker run -v "$(pwd)":/go/src/$pkg jkcfg/build "$@"
docker run -v "$HOME/.npm":/go/src/$pkg/.npm -v "$(pwd)":/go/src/$pkg jkcfg/build "$@"

0 comments on commit 06fac3c

Please sign in to comment.