Speed up examples CI builder (#572)

No need to `npm install` a bunch of times, we only need to do it once!
This commit is contained in:
Alex Crichton 2018-07-27 10:07:00 -07:00 committed by GitHub
parent 67b43ee389
commit 66649018ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,13 +51,14 @@ matrix:
# All examples work
- rust: nightly
env: JOB=examples-build
install: *INSTALL_NODE_VIA_NVM
before_install: *INSTALL_NODE_VIA_NVM
install: npm ci --verbose
script:
- mkdir node_modules
- |
for dir in `ls examples | grep -v README | grep -v asm.js | grep -v no_modules`; do
(cd examples/$dir &&
sed -i 's/: "webpack-dev-server"/: "webpack"/' package.json &&
sed -i 's/npm install//' build.sh &&
ln -s ../../node_modules . &&
./build.sh) || exit 1;
done